Skip to content

Commit

Permalink
Fixed powerLaw
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyuon committed Aug 1, 2024
1 parent 255fad3 commit fcdc120
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jimgw/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,15 @@ def __init__(
self.transform_func = lambda x: {
name_mapping[1][i]: (
self.xmin ** (1.0 + self.alpha)
+ x[0]
+ x[name_mapping[0][i]]
* (self.xmax ** (1.0 + self.alpha) - self.xmin ** (1.0 + self.alpha))
)
** (1.0 / (1.0 + self.alpha))
for i in range(len(name_mapping[0]))
}
self.inverse_transform_func = lambda x: {
name_mapping[0][i]: (
(x[0] ** (1.0 + self.alpha) - self.xmin ** (1.0 + self.alpha))
(x[name_mapping[1][i]] ** (1.0 + self.alpha) - self.xmin ** (1.0 + self.alpha))
/ (self.xmax ** (1.0 + self.alpha) - self.xmin ** (1.0 + self.alpha))
)
for i in range(len(name_mapping[1]))
Expand All @@ -424,12 +424,12 @@ def __init__(
self.xmax = xmax
self.transform_func = lambda x: {
name_mapping[1][i]: self.xmin
* jnp.exp(x[0] * jnp.log(self.xmax / self.xmin))
* jnp.exp(x[name_mapping[0][i]] * jnp.log(self.xmax / self.xmin))
for i in range(len(name_mapping[0]))
}
self.inverse_transform_func = lambda x: {
name_mapping[0][i]: (
jnp.log(x[0] / self.xmin) / jnp.log(self.xmax / self.xmin)
jnp.log(x[name_mapping[1][i]] / self.xmin) / jnp.log(self.xmax / self.xmin)
)
for i in range(len(name_mapping[1]))
}

0 comments on commit fcdc120

Please sign in to comment.