pypomp.core.pomp.Pomp.pfilter

Pomp.pfilter(J: int, key: Array | None = None, theta: Mapping[str, int | float | number | Array] | Sequence[Mapping[str, int | float | number | Array]] | pypomp.core.parameters.PompParameters | None = None, thresh: float = 0, reps: int = 1, CLL: bool = False, ESS: bool = False, filter_mean: bool = False, prediction_mean: bool = False, track_time: bool = True) None[source]

Evaluates the likelihood of the model via the particle filter (bootstrap filter).

The particle filter (also known as Sequential Monte Carlo) estimates the log-likelihood of the data given a specific set of parameters by propagating a swarm of particles through the latent state space. It can also be used to estimate the latent states over time (via filtering or prediction means).

This implementation leverages JAX to efficiently vectorize the algorithm across multiple parameter sets simultaneously. Results are automatically stored in the model’s history and can be accessed using self.results().

Parameters:
  • J (int) – The number of particles

  • key (jax.Array, optional) – The random key. Defaults to self.fresh_key.

  • theta (ThetaInput, optional) – Parameters involved in the POMP model. Defaults to self.theta. Accepts: - A single dictionary: dict[str, Numeric] - A list of dictionaries: list[dict[str, Numeric]] - An existing PompParameters object Providing a list or PompParameters object enables faster, vectorized execution across all parameter sets.

  • thresh (float, optional) – Threshold value to determine whether to resample particles. Defaults to 0.

  • reps (int, optional) – Number of replicates to run. Defaults to 1.

  • CLL (bool, optional) – Boolean flag controlling whether to compute and store the conditional log-likelihoods at each time point.

  • ESS (bool, optional) – Boolean flag controlling whether to compute and store the effective sample size at each time point.

  • filter_mean (bool, optional) – Boolean flag controlling whether to compute and store the filtered mean at each time point.

  • prediction_mean (bool, optional) – Boolean flag controlling whether to compute and store the prediction mean at each time point.

  • track_time (bool, optional) – Boolean flag controlling whether to track the execution time.

Returns:

None. Updates self.results_history with a PompPFilterResult containing the log-likelihoods, and optionally the conditional log-likelihoods (CLL), effective sample size (ESS), filtered means, and prediction means if requested.