Learn R Programming

pomp (version 0.21-3)

pfilter: Particle filter

Description

Run a particle filter.

Usage

pfilter(object, ...)
## S3 method for class 'pomp':
pfilter(object, params, Np, tol = 1e-17,
    warn = TRUE, max.fail = 0, pred.mean = FALSE, pred.var = FALSE,
    filter.mean = FALSE, .rw.sd, \dots)
## S3 method for class 'mif':
pfilter(object, params, Np, tol = 1e-17, warn = TRUE,
    max.fail = 0, pred.mean = FALSE, pred.var = FALSE,
    filter.mean = FALSE, \dots)

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 vec
Np
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
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
warn
Should filtering failures generate warnings?
max.fail
The maximum number of filtering failures allowed. If the number of filtering failures exceeds this number, execution will terminate with an error.
pred.mean
If TRUE, the prediction means are calculated for the state variables and parameters.
pred.var
If TRUE, the prediction variances are calculated for the state variables and parameters.
filter.mean
If TRUE, the filtering means are calculated for the state variables and parameters.
.rw.sd
For internal use with the MIF algorithm. If TRUE, the specified random walk SD is used.
...
Additional arguments unused at present.

Value

  • A list with the following elements:
  • pred.meanThe nvars+npars x ntimes matrix of prediction means, where ntimes is the length of the time series contained in object. The rows correspond to states and parameters, in that order.
  • pred.varianceThe matrix of prediction variances, in the same format as pred.mean.
  • filter.meanThe matrix of filtering means, in the same format as pred.mean.
  • eff.sample.sizeA vector containing the effective number of particles at each time point.
  • cond.loglikA vector containing the conditional log likelihoods at each time point.
  • nfailThe number of filtering failures encountered.
  • loglikThe estimated log-likelihood.

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

Run this code
## See the vignettes for examples.

Run the code above in your browser using DataLab