Skip to content

Commit 728b4d6

Browse files
committed
review
1 parent f5278d3 commit 728b4d6

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

doc/example/distributions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"cell_type": "markdown",
142142
"id": "dab4b2d1e0f312d8",
143143
"metadata": {},
144-
"source": "If a parameter scale is specified (`parameterScale=lin|log|log10`) and the chosen distribution is not a `parameterScale*`-type distribution, then the distribution parameters are taken as is, i.e., the `parameterScale` is not applied to the distribution parameters. In the context of PEtab prior distributions, `parameterScale` will only be used for the start point sampling for optimization, where the sample will be transformed accordingly. This is demonstrated below. The left plot always shows the prior distribution for unscaled parameter values, and the right plot shows the prior distribution for scaled parameter values. Note that in the objective function, the prior is always on the unscaled parameters.\n"
144+
"source": "If a parameter scale is specified (`parameterScale=lin|log|log10`), the distribution parameters are used as is without applying the `parameterScale` to them. The exception are the `parameterScale*`-type distributions, as explained below. In the context of PEtab prior distributions, `parameterScale` will only be used for the start point sampling for optimization, where the sample will be transformed accordingly. This is demonstrated below. The left plot always shows the prior distribution for unscaled parameter values, and the right plot shows the prior distribution for scaled parameter values. Note that in the objective function, the prior is always on the unscaled parameters.\n"
145145
},
146146
{
147147
"cell_type": "code",

petab/v1/distributions.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Distribution(abc.ABC):
2727
:param log: If ``True``, the distribution is transformed to its
2828
corresponding log distribution (e.g., Normal -> LogNormal).
2929
If a float, the distribution is transformed to its corresponding
30-
log distribution with the given base (e.g., Normal -> Log10Normal).
30+
log distribution with the given log-base (e.g., Normal -> Log10Normal).
3131
If ``False``, no transformation is applied.
3232
:param trunc: The truncation points (lower, upper) of the distribution
3333
or ``None`` if the distribution is not truncated.
@@ -99,7 +99,7 @@ def _exp(self, x: np.ndarray | float) -> np.ndarray | float:
9999
def _log(self, x: np.ndarray | float) -> np.ndarray | float:
100100
"""Apply the log transformation if enabled.
101101
102-
Compute the log of x with the specified base if a log transformation
102+
Compute the log of `x` with the specified base if a log transformation
103103
is applied to the distribution. Otherwise, return the input.
104104
105105
:param x: The value to transform.
@@ -279,11 +279,10 @@ class Normal(Distribution):
279279
are the truncation limits of the transformed distribution.
280280
:param log: If ``True``, the distribution is transformed to a log-normal
281281
distribution. If a float, the distribution is transformed to a
282-
log-normal distribution with the given base.
282+
log-normal distribution with the given log-base.
283283
If ``False``, no transformation is applied.
284284
If a transformation is applied, the location and scale parameters
285-
and the truncation limits are the location, scale and truncation limits
286-
of the underlying normal distribution.
285+
are the location and scale of the underlying normal distribution.
287286
"""
288287

289288
def __init__(
@@ -332,7 +331,7 @@ class Uniform(Distribution):
332331
:param high: The upper bound of the distribution.
333332
:param log: If ``True``, the distribution is transformed to a log-uniform
334333
distribution. If a float, the distribution is transformed to a
335-
log-uniform distribution with the given base.
334+
log-uniform distribution with the given log-base.
336335
If ``False``, no transformation is applied.
337336
If a transformation is applied, the lower and upper bounds are the
338337
lower and upper bounds of the underlying uniform distribution.
@@ -376,11 +375,10 @@ class Laplace(Distribution):
376375
are the truncation limits of the transformed distribution.
377376
:param log: If ``True``, the distribution is transformed to a log-Laplace
378377
distribution. If a float, the distribution is transformed to a
379-
log-Laplace distribution with the given base.
378+
log-Laplace distribution with the given log-base.
380379
If ``False``, no transformation is applied.
381380
If a transformation is applied, the location and scale parameters
382-
and the truncation limits are the location, scale and truncation limits
383-
of the underlying Laplace distribution.
381+
are the location and scale of the underlying Laplace distribution.
384382
"""
385383

386384
def __init__(

0 commit comments

Comments
 (0)