pypomp.Pomp.mif

Pomp.mif(J: int, M: int, rw_sd: RWSigma, key: Array | None = None, theta: PompParameters | None = None, thresh: float = 0.0, n_monitors: int = 0, track_time: bool = True) None

Estimate parameters via the Iterated Filtering 2 (IF2) algorithm.

Maximizes the marginal log-likelihood via the Iterated Filtering 2 (IF2) algorithm (Ionides et al. 2015 [1]) by perturbing parameters with random walks that shrink (cool) over M iterations. Each iteration runs a bootstrap particle filter with the perturbed parameter swarm, then records the mean parameter values as the estimate for that iteration.

JAX vectorises the computation across all starting parameter sets in theta simultaneously.

Parameters:
  • J (int) – Number of particles.

  • M (int) – Number of IF2 iterations.

  • rw_sd (RWSigma) – Random walk standard deviation configuration, including per- parameter sigmas and a cooling schedule. See RWSigma.

  • key (jax.Array or None, optional) – JAX random key. Defaults to fresh_key.

  • theta (PompParameters or None, optional) – Starting parameter set(s). Defaults to theta.

  • thresh (float, optional) – ESS-based resampling threshold in the interval \([0, 1]\). Defaults to 0.0.

  • n_monitors (int, optional) – Number of unperturbed particle filter runs to average for the log-likelihood monitor at each iteration. Defaults to 0 (uses the log-likelihood from the perturbed filter directly).

  • track_time (bool, optional) – Whether to record wall-clock execution time. Defaults to True.

Returns:

A Result is appended to results_history, containing the log-likelihood monitor, parameter traces over iterations, and algorithm settings.

Return type:

None

See also

pypomp.functional.mif

Pure-functional JAX IF2.

References

Examples

>>> rw = pp.RWSigma({"beta": 0.02, "gamma": 0.01}).geometric_cooling(0.5)
>>> model.fresh_key = jax.random.key(0)
>>> model.mif(J=1000, M=50, rw_sd=rw)
>>> model.traces()  # DataFrame with logLik and parameter traces