pypomp.functional.mop¶
- pypomp.functional.mop(struct: PompStruct, thetas_array: Array, J: int, alpha: float, keys: Array) Array[source]¶
This is a pure functional implementation of the MOP differentiable particle filter, intended for users who need to compose it within custom JAX loops or higher-order functions. For a more user-friendly (but impurely-functional) interface to train models using the MOP objective, see
pypomp.core.pomp.Pomp.train().Unlike the standard particle filter (
pypomp.functional.pfilter()), the MOP objective is specifically designed to be fully differentiable with respect to the model parameters. This allows for the computation of gradients and Hessians of the log-likelihood using JAX’s automatic differentiation capabilities.This function evaluates the log-likelihood for the given parameter sets, but it is primarily intended to be used as an objective function within gradient-based optimization routines (e.g.,
pypomp.functional.train()).- Parameters:
struct (PompStruct) – The compiled structural representation of the POMP model.
thetas_array (jax.Array) – Array of initial parameters. Shape (n_reps, n_params). Must be aligned with the canonical order of struct.param_names (e.g. prepared via align_params).
J (int) – Number of particles.
alpha (float) – Alpha parameter for MOP.
keys (jax.Array) – Random keys. Shape (n_reps, …).
- Returns:
Negative MOP log-likelihood estimates.
- Return type:
Note
To align and stack input parameter dictionaries/scalars into the correct canonical ordering required by these arrays, you can use
pypomp.functional.align_params().