Learn R Programming

pomp (version 0.45-8)

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 = Inf, 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, \dots)

Arguments

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
pompExample(gompertz)
pf <- pfilter(gompertz,Np=1000)	## use 1000 particles
logLik(pf)
cond.logLik(pf)			## conditional log-likelihoods
eff.sample.size(pf)
logLik(pfilter(gompertz))      	## run it again with 1000 particles
logLik(pfilter(gompertz,Np=2000))    	## run it with 2000 particles and get the filtering means

## See the vignettes for more examples.

Run the code above in your browser using DataLab