Approximate Bayesian Computation

Contains the implementations for the Approximate Bayesian Computation methods

Implements the supported Approximate Bayesian Computation methods.

class calisim.abc.implementation.ApproximateBayesianComputationMethod(calibration_func: Callable, specification: ApproximateBayesianComputationMethodModel, engine: str = 'pymc', implementation: CalibrationWorkflowBase | None = None)[source]

The Approximate Bayesian Computation method class.

pydantic model calisim.abc.implementation.ApproximateBayesianComputationMethodModel[source]

The Approximate Bayesian Computation method data model.

Parameters:

BaseModel (CalibrationModel) – The calibration base model class.

Config:
  • arbitrary_types_allowed: bool = True

  • protected_namespaces: tuple = ()

Fields:
field distance: str | Callable | None = None

The distance function between observed and simulated data

field epsilon: float = 0

The dissimilarity threshold between observed and simulated data

field min_population_size: int = 5

The minimum population size

field n_bootstrap: int = 5

The number of bootstrap samples

field sum_stat: str | Callable = 'identity'

The summary statistic function for observed and simulated data

calisim.abc.implementation.get_implementations() dict[str, type[CalibrationWorkflowBase]][source]

Get the calibration implementations for Approximate Bayesian Computation.

Returns:

The dictionary of

calibration implementations for Approximate Bayesian Computation.

Return type:

Dict[str, type[CalibrationWorkflowBase]]

PyABC

Contains the implementations for Approximate Bayesian Computation methods using PyABC

Implements the supported Approximate Bayesian Computation methods using the PyABC library.

class calisim.abc.pyabc_wrapper.PyABCApproximateBayesianComputation(calibration_func: Callable, specification: CalibrationModel, task: str)[source]

The PyABC Approximate Bayesian Computation method class.

analyze() None[source]

Analyze the results of the simulation calibration procedure.

dist_name_processing(name: str) str[source]

Apply data preprocessing to the distribution name.

Parameters:

name (str) – The unprocessed distribution name.

Returns:

The processed distribution name.

Return type:

str

execute() None[source]

Execute the simulation calibration procedure.

specify() None[source]

Specify the parameters of the model calibration procedure.

PyMC

Contains the implementations for Approximate Bayesian Computation methods using PyMC

Implements the supported Approximate Bayesian Computation methods using the PyMC library.

class calisim.abc.pymc_wrapper.PyMCApproximateBayesianComputation(calibration_func: Callable, specification: CalibrationModel, task: str)[source]

The PyMC Approximate Bayesian Computation method class.

analyze() None[source]

Analyze the results of the simulation calibration procedure.

execute() None[source]

Execute the simulation calibration procedure.

specify() None[source]

Specify the parameters of the model calibration procedure.