amici.petab.simulations
Functionality related to simulation of PEtab problems.
Functionality related to running simulations or evaluating the objective function as defined by a PEtab problem.
Functions
|
Aggregate likelihood gradient for all conditions, according to PEtab parameter mapping. |
|
Create a measurement dataframe in the PEtab format from the passed |
|
Create a PEtab simulation dataframe from |
|
Rescale a sensitivity between parameter scales. |
|
Simulate PEtab model. |
- amici.petab.simulations.simulate_petab(petab_problem, amici_model, solver=None, problem_parameters=None, simulation_conditions=None, edatas=None, parameter_mapping=None, scaled_parameters=False, log_level=30, num_threads=1, failfast=True, scaled_gradients=False)[source]
Simulate PEtab model.
Note
Regardless of scaled_parameters, unscaled sensitivities are returned, unless scaled_gradients=True.
- Parameters:
petab_problem (
petab.v1.problem.Problem
) – PEtab problem to work on.amici_model (
typing.Union
[amici.amici.Model
,amici.amici.ModelPtr
]) – AMICI Model assumed to be compatible withpetab_problem
.solver (
amici.amici.Solver
|None
) – An AMICI solver. Will use default options if None.problem_parameters (
dict
[str
,float
] |None
) – Run simulation with these parameters. IfNone
, PEtabnominalValues
will be used. To be provided as dict, mapping PEtab problem parameters to SBML IDs.simulation_conditions (
pandas.core.frame.DataFrame
|dict
) – Result ofpetab.get_simulation_conditions()
. Can be provided to save time if this has be obtained before. Not required ifedatas
andparameter_mapping
are provided.edatas (
list
[typing.Union
[amici.amici.ExpData
,amici.amici.ExpDataPtr
]]) – Experimental data. Parameters are inserted in-place for simulation.parameter_mapping (
amici.petab.parameter_mapping.ParameterMapping
) – Optional precomputed PEtab parameter mapping for efficiency, as generated bycreate_parameter_mapping()
withscaled_parameters=True
.scaled_parameters (
bool
|None
) – IfTrue
,problem_parameters
are assumed to be on the scale provided in the PEtab parameter table and will be unscaled. IfFalse
, they are assumed to be in linear scale. If parameter_mapping is provided, this must match the value of scaled_parameters used to generate the mapping.log_level (
int
) – Log level, seeamici.logging
module.num_threads (
int
) – Number of threads to use for simulating multiple conditions (only used if compiled with OpenMP).failfast (
bool
) – Returns as soon as an integration failure is encountered, skipping any remaining simulations.scaled_gradients (
bool
) – Whether to compute gradients on parameter scale (True
) or not (False
).
- Return type:
- Returns:
Dictionary of
cost function value (
LLH
),list of
amici.amici.ReturnData
(RDATAS
),list of
amici.amici.ExpData
(EDATAS
),
corresponding to the different simulation conditions. For ordering of simulation conditions, see
petab.Problem.get_simulation_conditions_from_measurement_df()
.