pfilter {pomp}R Documentation

Particle filter

Description

Run a plain vanilla particle filter. Resampling is performed after each observation.

Usage

pfilter(object, ...)
## S4 method for signature 'pomp':
pfilter(object, params, Np, tol = 1e-17,
    max.fail = 0, pred.mean = FALSE, pred.var = FALSE,
    filter.mean = FALSE, save.states = FALSE,
    verbose = getOption("verbose"), ...)
## S4 method for signature 'mif':
pfilter(object, params, Np, tol = 1e-17,
    max.fail = 0, pred.mean = FALSE, pred.var = FALSE,
    filter.mean = FALSE, ...)

Arguments

object An object of class pomp or inheriting class pomp.
params A npars x Np matrix containing the parameters corresponding to the initial state values in xstart. This must have a 'rownames' attribute. It is permissible to supply params as a named numeric vector, i.e., without a dim attribute. In this case, all particles will inherit the same parameter values.
Np integer; number of particles to use. When object is of class mif, this is by default the same number of particles used in the mif iterations.
tol positive numeric scalar; particles with log likelihood below tol are considered to be "lost". A filtering failure occurs when, at some time point, all particles are lost. When all particles are lost, the conditional log likelihood at that time point is set to be log(tol).
max.fail integer; the maximum number of filtering failures allowed. If the number of filtering failures exceeds this number, execution will terminate with an error.
pred.mean logical; if TRUE, the prediction means are calculated for the state variables and parameters.
pred.var logical; if TRUE, the prediction variances are calculated for the state variables and parameters.
filter.mean logical; if TRUE, the filtering means are calculated for the state variables and parameters.
save.states logical; if TRUE, the state-vector for each particle is saved and returned.
verbose logical; if TRUE, progress information is reported as pfilter works.
... Additional arguments unused at present.

Value

A list with the following elements:

pred.mean The matrix of prediction means. The rows correspond to states and parameters (if appropriate), in that order, the columns to successive observations in the time series contained in object.
pred.var The matrix of prediction variances, in the same format as pred.mean.
filter.mean The matrix of filtering means, in the same format as pred.mean.
eff.sample.size A vector containing the effective number of particles at each time point.
cond.loglik A vector containing the conditional log likelihoods at each time point.
states If saves.states=TRUE, the array of state-vectors at each time point, for each particle. An array with dimensions nvars-by-Np-by-ntimes. In particular, states[,i,t] can be considered a sample from f[X|y_{1:t}].
nfail The number of filtering failures encountered.
loglik The estimated log-likelihood.

Author(s)

Aaron A. King kingaa at umich dot edu

References

M. S. Arulampalam, S. Maskell, N. Gordon, & T. Clapp. A Tutorial on Particle Filters for Online Nonlinear, Non-Gaussian Bayesian Tracking. IEEE Trans. Sig. Proc. 50:174–188, 2002.

See Also

pomp-class

Examples

## See the vignettes for examples.

[Package pomp version 0.27-1 Index]