pypomp.Pomp.pfilter¶
- Pomp.pfilter(J: int, key: Array | None = None, theta: PompParameters | None = None, thresh: float = 0.0, reps: int = 1, CLL: bool = False, ESS: bool = False, filter_mean: bool = False, prediction_mean: bool = False, track_time: bool = True) None¶
Evaluate the log-likelihood via the bootstrap particle filter.
Propagates a swarm of
Jparticles through the latent state space using Sequential Monte Carlo (bootstrap filter) to estimate the marginal log-likelihood of the observed data. Optionally computes conditional log-likelihoods, effective sample size, filtered means, and prediction means.JAX vectorises the computation across all parameter sets in
thetasimultaneously.- Parameters:
J (int) – Number of particles.
key (jax.Array or None, optional) – JAX random key. Defaults to
fresh_key.theta (PompParameters or None, optional) – Parameter set(s) to evaluate. Defaults to
theta.thresh (float, optional) – ESS-based resampling threshold in the interval \([0, 1]\). Defaults to
0.0(resample at every step).reps (int, optional) – Number of independent filter replicates per parameter set. Defaults to
1.CLL (bool, optional) – Whether to compute and store conditional log-likelihoods at each observation time. Defaults to
False.ESS (bool, optional) – Whether to compute and store the effective sample size at each observation time. Defaults to
False.filter_mean (bool, optional) – Whether to compute and store the filtered state mean at each observation time. Defaults to
False.prediction_mean (bool, optional) – Whether to compute and store the predicted state mean at each observation time. Defaults to
False.track_time (bool, optional) – Whether to record wall-clock execution time. Defaults to
True.
- Returns:
A
Resultis appended toresults_history. Retrieve a dataframe summary withresults()or the log-likelihoods directly viamodel.theta.logLik.- Return type:
None
See also
pypomp.functional.pfilterPure-functional JAX particle filter.
Examples
>>> model.fresh_key = jax.random.key(0) >>> model.pfilter(J=1000) >>> model.results() # DataFrame with logLik and parameter columns