pfilter {pomp} | R Documentation |
Run a particle filter.
pfilter(object, ...) ## S4 method for signature 'pomp': pfilter(object, xstart, params, tol = 1e-17, warn = TRUE, max.fail = 0, pred.mean = FALSE, pred.var = FALSE, filter.mean = FALSE, .rw.sd, ...) ## S4 method for signature 'mif': pfilter(object, Np, coef, tol = 1e-17, warn = TRUE, max.fail = 0, pred.mean = FALSE, pred.var = FALSE, filter.mean = FALSE, ...)
object |
An object of class pomp or inheriting class
pomp . |
xstart |
A nvars x np matrix containing the initial
state-values of the np particles. This must have a
`rownames' attribute. |
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 |
Number of particles to use. By default, this is the number
of particles used in the mif iterations. |
coef |
Coefficients at which to estimate the log likelihood. By
default, coef(object) is used. |
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 be
log(tol) . |
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. |
A list with the following elements:
pred.mean |
The 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.variance |
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. |
nfail |
The number of filtering failures encountered. |
loglik |
The estimated log-likelihood. |
Aaron A. King (kingaa at umich dot edu)
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 the vignettes for examples.