distrib¶
The formulas of the distributions of the fitted parameters, without a simulator.
A fitted parameter carries the distribution of its draws as a formula of the
SBML package distrib: normal(mean, sd[, lower, upper]),
lognormal(mu, sigma[, lower, upper]) (mu and sigma of the natural logarithm)
and uniform(lower, upper), with numbers as arguments, truncated to the bounds
of the fit when they are given. This module is the one grammar of these
formulas: the draws of the fitted parameters parse them into the distributions
of sbmlsim.simulation.sampling, and a library which must not import a
simulator, e.g. the PBPK library of pkpdsim, reads their support to bound a
fitted fraction. It imports only the standard library, so its import loads
neither roadrunner nor the sampler.
ARGUMENTS
module-attribute
¶
The distributions and their numbers of arguments; the last two of four are the bounds of a truncation.
UNCERTAINTY_DIMENSION
module-attribute
¶
The id of the dimension of the draws of the fitted parameters of a model, see
sbmlsim.simulation.sampling.uncertainty_dimension.
DistribFormula
dataclass
¶
A formula of a distribution of distrib.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
the distribution, a key of |
args |
tuple[float, ...]
|
the arguments. |
parse
¶
Parse a formula of a distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formula
|
str
|
e.g. |
required |
Returns:
| Type | Description |
|---|---|
DistribFormula
|
The distribution and its arguments. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the formula is no function of numbers, or no
distribution of |
support
¶
Get the support of a distribution: the values its draws can take.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formula
|
str
|
the formula of the distribution. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The bounds of a truncated or uniform distribution; without bounds |
float
|
|
tuple[float, float]
|
|
check_band
¶
Check the draws and the quantiles of the bands of a run over the draws.
The one check of sbmlsim.experiment.draws.UncertaintySettings and of the
draws of the kind simulate (sbmlsim.run.scan_kinds.DrawsSpec), which
checks a spec without importing the experiments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
draws
|
int
|
the number of draws. |
required |
quantiles
|
tuple[float, ...]
|
the lower and the upper quantile of the bands. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
The quantiles as floats. |
Raises:
| Type | Description |
|---|---|
ValueError
|
for less than two draws or quantiles which are not an
increasing pair within |