Learn R Programming

pomp (version 0.39-3)

pfilter: Particle filter

Description

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

Usage

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

Arguments

object
An object of class pomp or inheriting class pomp.
params
A npars x Np numeric matrix containing the parameters corresponding to the initial state values in xstart. This must have a rownames attribute. If it desired that all particles should share t
Np
the number of particles to use. This may be specified as a single positive integer, in which case the same number of particles will be used at each timestep. Alternatively, if one wishes the number of particles to vary across timesteps, one may sp
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
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, save.params
logical. If save.states=TRUE, the state-vector for each particle at each time is saved in the saved.states slot of the returned pfilterd.pomp object.
seed
optional; an object specifying if and how the random number generator should be initialized (seeded). If seed is an integer, it is passed to set.seed prior to any simulation and is returned as the see
verbose
logical; if TRUE, progress information is reported as pfilter works.
...
Additional arguments unused at present.

Value

  • An object of class pfilterd.pomp. This class inherits from class pomp and contains the following additional slots: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] These can be accessed using the $ operator as if the returned object were a list. In addition, logLik returns the log likelihood. Note that if the argument params is a named vector, then these parameters are included in the params slot of the returned pfilterd.pomp object. That is coef(pfilter(obj,params=theta))==theta if theta is a named vector of parameters.

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