pypomp.functional.mif

pypomp.functional.mif(struct: PompStruct, thetas_array: Array, sigmas_array: Array, sigmas_init_array: Array, M: int, cooling_fn: Callable | float, J: int, keys: Array, thresh: float = 0.0, n_monitors: int = 0) tuple[Array, Array, Array][source]

Run the Iterated Filtering 2 (IF2) algorithm on a POMP model struct.

Pure-functional implementation of the Iterated Filtering 2 (IF2) algorithm (Ionides et al. 2015 [1]), intended for users who need to compose the algorithm within custom JAX loops or higher-order functions. For the standard interface, see pypomp.Pomp.mif().

JAX vectorises the computation across all starting parameter sets simultaneously.

Parameters:
  • struct (PompStruct) – Compiled structural representation of the POMP model. Obtain via to_struct().

  • thetas_array (jax.Array) – Initial parameter array of shape (n_reps, J, n_params) on the natural scale. Must be aligned with struct.param_names.

  • sigmas_array (jax.Array) – Per-parameter random walk standard deviations. Shape (n_params,).

  • sigmas_init_array (jax.Array) – Initial random walk standard deviations. Shape (n_params,).

  • M (int) – Number of IF2 iterations.

  • cooling_fn (callable or float) – Cooling schedule. Pass a callable (nt, m, ntimes) -> float for custom schedules, or a single float for geometric cooling.

  • J (int) – Number of particles.

  • keys (jax.Array) – Random keys of shape (n_reps, ...).

  • thresh (float, optional) – ESS-based resampling threshold. Defaults to 0.0.

  • n_monitors (int, optional) – Number of unperturbed filter runs for log-likelihood monitoring. Defaults to 0.

Returns:

  • Negative log-likelihood history of shape (n_reps, M).

  • Parameter trace history of shape (n_reps, M+1, n_params) on the natural scale.

  • Final particle swarm of shape (n_reps, J, n_params) on the natural scale.

Return type:

tuple of (jax.Array, jax.Array, jax.Array)

Notes

To align and stack input parameter dictionaries into the correct canonical ordering, use pypomp.functional.align_params().

See also

pypomp.Pomp.mif

Object-oriented interface.

align_params

Parameter alignment utility.

References