sensitivity.result¶
The result of a sensitivity analysis.
SensitivityResult wraps an xarray.Dataset with one variable per observable
and index, <observable>.<index> (e.g. auc.ST, auc.ST_conf,
[S2].normalized), over (parameter, *other dimensions, [time]): the
parameters of the design, every label of the other dimensions of the scan
(e.g. doses, conditions) and, for a timecourse on a grid, every time point.
attrs carry the units of every variable, the method, its options and the
provenance of the scan.
SensitivityResult
¶
The indices of a sensitivity analysis, see the module.
Attributes:
| Name | Type | Description |
|---|---|---|
ds |
the dataset. |
Wrap a dataset of indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds
|
Dataset
|
the dataset. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the dataset has no dimension |
index
¶
Stack an index of the scalar observables into (parameter, observable, ...).
A timecourse is stacked at one time point, e.g. sel(time=10).index(...),
which is the state after a change at the time 10, see sel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the index, e.g. |
required |
observables
|
Sequence[str] | None
|
the observables, every scalar observable which has the index by default. |
None
|
Returns:
| Type | Description |
|---|---|
DataArray
|
The index over |
Raises:
| Type | Description |
|---|---|
KeyError
|
if no scalar observable has the index. |
ValueError
|
if |
sel
¶
Select labels, see xarray.Dataset.sel.
A single label of parameter keeps the dimension, which a result has:
sel(parameter="k1") is sel(parameter=["k1"]). A single time of a
change after the start, which a timecourse has twice, selects the
state after the change, see at_one_time; isel selects either.
isel
¶
Select positions, see xarray.Dataset.isel.
A single position of parameter keeps the dimension, as in sel.
to_dataframe
¶
Get a variable as a table, a row per parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the variable, e.g. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The table; the other dimensions are its columns. |
classify
¶
Classify every value of an index, see sensitivity_classification.
The thresholds are the ones of the IPCS for normalized local
sensitivities, which need an index without a unit
(DIMENSIONLESS_INDICES), e.g. normalized, S1 or ST.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
the variable, e.g. |
required |
Returns:
| Type | Description |
|---|---|
DataArray
|
The classes as strings ( |
DataArray
|
for |
Raises:
| Type | Description |
|---|---|
ValueError
|
if the index has a unit, e.g. |
to_netcdf
¶
Write the result as netCDF, the attributes as JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
the file. |
required |
from_netcdf
classmethod
¶
Read a result written by to_netcdf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
the file. |
required |
Returns:
| Type | Description |
|---|---|
SensitivityResult
|
The result. |
at_one_time
¶
Select a single time which the data has twice as its state after the change.
The time of a change after the start appears twice in a timecourse, the
states before and after the change; a single time selects the state after
it, as a time of a grid does (sbmlsim.result.timecourse.grid_weights).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
T
|
the data. |
required |
indexers
|
dict[str, Any]
|
the labels to select, by dimension. |
required |
Returns:
| Type | Description |
|---|---|
T
|
The data at the time, if it has it twice, and the other indexers; else |
dict[str, Any]
|
the data and the indexers. |