particleFilter | R Documentation |
The particle filter returns an estimate of the marginal log-likelihood L
= p(y(t_{1:T})|\theta)
as well as the set of filtered trajectories and their
respective weights at the last observation time
\omega(t_T)=p(y(t_T)|\theta)
.
particleFilter(fitmodel, theta, initState, data, nParticles, progress = FALSE)
fitmodel |
a |
theta |
named numeric vector. Values of the parameters. Names should
match |
initState |
named numeric vector. Initial values of the state
variables. Names should match |
data |
data frame. Observation times and observed data. The time column
must be named |
nParticles |
number of particles |
progress |
if |
A list of 3 elements:
dPointObs
the marginal log-likelihood of the theta.
traj
a list of size nParticles
with all filtered
trajectories.
trajWeight
a vector of size nParticles
with the
normalised weight of the filtered trajectories.
An unbiased state sample x(t_{0:T}) ~
p(X(t_{0:T})|\theta,y(t_{0:T}))
can be obtained by sampling the set of
trajectories traj
with probability trajWeight
.
plotSMC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.