API documentation

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

load_instances()

Iterate over scenario instances for each scenario.

forecast()

Generate forecasts at specific times for a single scenario.

fit()

Fit the simulation model to all of the available observations.

adaptive_fit()

Fit the simulation model to all of the available observations in a series of passes, where in each pass the observation models are refined.

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.scenario

Reads forecast scenarios from TOML files

pypfilt.model

Defines the simulation model base class Model

pypfilt.obs

Defines the observation model base class Obs

pypfilt.time

Provides scalar and date-time simulation time scales

pypfilt.summary

Provides common summary statistics and records outputs

pypfilt.event

Defines data structures for event handlers

pypfilt.plot

Provides functions for plotting summary statistics

pypfilt.io

Reads data tables from text files

pypfilt.crps

Calculates CRPS scores for simulated observations

pypfilt.examples

Provides example models

Secondary pypfilt modules, which you will rarely (if ever) use directly.

Module

Description

pypfilt.adaptive

Implements adaptive fitting methods

pypfilt.build

Builds simulation contexts

pypfilt.cache

Implements the particle filter state cache

pypfilt.pfilter

The particle filter core: time-steps and adjusting particle weights

pypfilt.resample

Implements particle resampling and post-regularisation

pypfilt.sampler

Construct sampling functions for each model parameter

pypfilt.state

Creates the state history matrix

pypfilt.stats

Calculates weighted quantiles, credible intervals, etc