Skip to contents

Storage class for the result of a bootstrap particle filter analysis. The class holds the model with a sampled trajectory attached, the number of particles used, the estimated conditional log-likelihood at each time-point, and the effective sample size (ESS) at each time-point.

Slots

model

A SimInf_model object with one complete sampled trajectory attached. At the end of the filtering, a single particle is drawn from the ensemble at the final time-point, and its full state evolution across all time-points is reconstructed.

n_particles

An integer with the number of particles that were used at each time-point.

cond_loglik

A numeric vector with the estimated conditional log-likelihood contribution of each time-point, computed from the particle weights at that time-point.

ess

A numeric vector with the effective sample size (ESS) at each time-point, computed from the normalized particle weights before resampling. A small ESS indicates that few particles carry most of the weight, and that more particles may be needed. The effective sample size is computed as $$\left(\sum_{i=1}^N\!(w_{t}^{i})^2\right)^{-1},$$ where \(w_{t}^{i}\) is the normalized weight of particle \(i\) at time \(t\).

See also

pfilter for running a bootstrap particle filter and creating objects of this class, logLik for extracting the log-likelihood, trajectory for extracting the filtered trajectory, prevalence for computing prevalence from the filtered trajectory, SimInf_model for the underlying model class.