Description Usage Arguments Value Author(s) References See Also
Run a plain vanilla particle filter. Resampling is performed at each observation.
1 2 3 4 5 6 7 8 9 | ## S4 method for signature 'pomp'
pfilter2(object, params, Np, tol = 1e-17,
max.fail = Inf, pred.mean = FALSE, pred.var = FALSE,
filter.mean = FALSE,
save.states = FALSE,
save.params = FALSE, lag=0, seed = NULL,
verbose = getOption("verbose"), ...)
## S4 method for signature 'pfilterd2.pomp'
pfilter2(object, params, Np, tol, ...)
|
object |
An object of class |
params |
A |
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 specify |
tol |
positive numeric scalar; particles with likelihood less than |
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.
By default, |
pred.mean |
logical; if |
pred.var |
logical; if |
filter.mean |
logical; if |
save.states, save.params |
logical.
If |
lag |
positive numeric scalar; use for fixed lag smoothing. |
seed |
optional; an object specifying if and how the random number generator should be initialized (‘seeded’).
If |
verbose |
logical; if |
... |
By default, when |
An object of class pfilterd2.pomp
.
This class inherits from class pomp
and contains the following additional slots:
matrices of prediction means, variances, and filter means, respectively.
In each of these, the rows correspond to states and parameters (if appropriate), in that order, the columns to successive observations in the time series contained in object
.
numeric vector containing the effective number of particles at each time point.
numeric vector containing the conditional log likelihoods at each time point.
If pfilter2
was called with save.states=TRUE
, this is the list of state-vectors at each time point, for each particle.
It is a length-ntimes
list of nvars
-by-Np
arrays.
In particular, saved.states[[t]][,i]
can be considered a sample from f[X_t|y_{1:t}].
If pfilter2
was called with save.params=TRUE
, this is the list of parameter-vectors at each time point, for each particle.
It is a length-ntimes
list of npars
-by-Np
arrays.
In particular, saved.params[[t]][,i]
is the parameter portion of the i-th particle at time t.
the state of the random number generator at the time pfilter2
was called.
If the argument seed
was specified, this is a copy;
if not, this is the internal state of the random number generator at the time of call.
the number of particles used, failure tolerance, and number of filtering failures, respectively.
the estimated log-likelihood.
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 pfilterd2.pomp
object.
That is coef(pfilter2(obj,params=theta))==theta
if theta
is a named vector of parameters.
Dao Nguyen nguyenxd at umich dot edu, Edward L. Ionides ionides 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.