pmcmc | R Documentation |
Run a pmcmc sampler
pmcmc(pars, filter, initial = NULL, control = NULL)
pars |
A |
filter |
A |
initial |
Optional initial starting point. If given, it must
be compatible with the parameters given in |
control |
A pmcmc_control object which will control how the MCMC runs, including the number of steps etc. |
This is a basic Metropolis-Hastings MCMC sampler. The
filter
is run with a set of parameters to evaluate the
likelihood. A new set of parameters is proposed, and these
likelihoods are compared, jumping with probability equal to their
ratio. This is repeated for n_steps
proposals.
While this function is called pmcmc
and requires a particle
filter object, there's nothing special about it for particle
filtering. However, we may need to add things in the future that
make assumptions about the particle filter, so we have named it
with a "p".
A mcstate_pmcmc
object containing pars
(sampled parameters) and probabilities
(log prior, log
likelihood and log posterior values for these
probabilities). Two additional fields may be present:
state
(if return_state
was TRUE
),
containing the final state of a randomly selected particle at
the end of the simulation, for each step (will be a matrix with
as many rows as your state has variables, and as n_steps + 1
columns corresponding to each step). trajectories
will
include a 3d array of particle trajectories through the
simulation (if return_trajectories
was TRUE
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.