Functional API¶
The pypomp.functional module provides a collection of pure, stateless JAX functions for model simulation and inference.
While the object-oriented Pomp class is recommended for most users, the functional API is intended for advanced users who need to compose algorithms within custom JAX loops, scan, or higher-order functions.
Data Structs¶
To use the functional API, you must first export your model’s structural data and compiled functions into a PompStruct or PanelPompStruct.
This can be done using the to_struct() or to_struct() methods.
|
Lightweight immutable JAX PyTree containing a compiled POMP model. |
|
A lightweight, immutable JAX PyTree holding the static data and compiled simulator functions for a PanelPOMP model. |
Core Algorithms¶
|
Run the bootstrap particle filter on a POMP model struct. |
|
Evaluate panel POMP log-likelihood via particle filtering. |
|
Run the Iterated Filtering 2 (IF2) algorithm on a POMP model struct. |
|
Estimate panel POMP parameters using Panel Iterated Filtering. |
|
Simulate latent states and observations from a POMP model struct. |
|
Functional PMCMC entry point. |
|
Functional ABC-MCMC entry point. |
Differentiable Particle Filtering¶
These functions are primarily used for gradient-based parameter estimation.
mop and dpop are designed to be fully differentiable with respect to the model parameters.
|
Optimize parameters via a differentiable particle filter (MOP). |
|
Optimize panel POMP parameters via a differentiable particle filter (MOP). |
|
MOP differentiable particle filter log-likelihood objective. |
|
DPOP differentiable particle filter log-likelihood objective. |
Utilities¶
|
Align and stack parameter arrays into the canonical ordering for a model struct. |