5. API documentation

The pypfilt module provides top-level functions for running forecasts and simulating observations from simulation models:

forecasts_iter()
Iterate over forecast settings for each scenario.
forecast()
Generate forecasts at specific times for a single scenario.
fit()
Fit the simulation model to all of the available observations.
simulate_from_model()
Simulate observations from the simulation model, according to each observation model.

It also contains a number of sub-modules. Some are intended for public use (see the key modules table), while others are likely of no use outside of pypfilt (see the secondary modules table).

Key pypfilt modules.
Module Description
pypfilt Provides model-fitting and forecasting functions
pypfilt.config Reads forecast scenarios from TOML files
pypfilt.sweep Iterates over forecast scenarios
pypfilt.model Defines the simulation model base class Model
pypfilt.obs Defines the observation model base class Obs
pypfilt.params Provides default parameter values for the particle filter
pypfilt.time Provides scalar and date-time simulation time scales
pypfilt.summary Provides common summary statistics and records outputs
pypfilt.plot Provides functions for plotting summary statistics
pypfilt.io Reads data tables from text files
pypfilt.examples Provides example models
Secondary pypfilt modules, which you will rarely (if ever) use directly.
Module Description
pypfilt.cache Implements the particle filter state cache
pypfilt.check Provides invariant checks for the state history matrix
pypfilt.context Manages simulation components, parameters, event handlers, etc.
pypfilt.pfilter The particle filter core: time-steps and adjusting particle weights
pypfilt.resample Implements particle resampling and post-regularisation
pypfilt.state Creates the state history matrix
pypfilt.stats Calculates weighted quantiles, credible intervals, etc