pyabc.petab

PEtab

Problem definitions in the PEtab format (https://petab.rtfd.io).

class pyabc.petab.AmiciPetabImporter(petab_problem: petab.Problem, amici_model: amici.sim.sundials.Model | None = None, amici_solver: amici.sim.sundials.Solver | None = None)[source]

Bases: PetabImporter

Import a PEtab model using AMICI to simulate it as a deterministic ODE.

Parameters:
  • petab_problem – A PEtab problem containing all information on the parameter estimation problem.

  • amici_model – A corresponding compiled AMICI model that allows simulating data for parameters. If not provided, one is created using amici.importers.petab.v1.import_petab_problem().

  • amici_solver – An AMICI solver to simulate the model. If not provided, one is created using amici_model.create_solver().

__init__(petab_problem: petab.Problem, amici_model: amici.sim.sundials.Model | None = None, amici_solver: amici.sim.sundials.Solver | None = None)[source]
create_kernel() → StochasticKernel[source]

Create acceptance kernel.

Returns:

A pyabc distribution encoding the kernel function.

Return type:

kernel

create_model(return_simulations: bool = False, return_rdatas: bool = False) → Callable[[Sequence | Mapping], Mapping][source]

Create model.

Note that since AMICI uses deterministic ODE simulations, it is usually not necessary to store simulations, as these can be reproduced from the parameters.

Parameters:
  • return_simulations – Whether to return the simulations also (large, can be stored in database).

  • return_rdatas – Whether to return the full list[amici.sim.sundials.ExpData] objects (large, cannot be stored in database).

Returns:

The model function, taking parameters and returning simulations. The model returns already the likelihood value.

Return type:

model