Learn R Programming

pomp (version 0.39-3)

bsmc: Liu and West Bayesian Particle Filter

Description

Generates draws from the posterior distribution for the parameters using the Liu and West algorithm. bsmc gives draws from the posterior.

Usage

## S3 method for class 'pomp':
bsmc(object, params, est, smooth = 0.1, ntries = 1,
     tol = 1e-17, lower = -Inf, upper = Inf, seed = NULL,
     verbose = getOption("verbose"), max.fail = 0, ...)

Arguments

object
An object of class pomp or inheriting class pomp.
params
A npars x np matrix containing the parameters corresponding to the initial state values in xstart. The matrix should be Np columns long, where Np is the number of particles. The values for each row should be Np
est
Names of the rows of params that are to be estimated. No updates will be made to the other parameters.
smooth
Kernel density smoothing parameters. The compensating shrinkage factor will be sqrt(1-smooth^2). Thus, smooth=0 means that no noise will be added to parameters. Generally, the value of smooth should be ch
ntries
Number of draws from rprocess per particle used to estimate the expected value of the state process at time t+1 given the state and parameters at time t.
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
lower, upper
optional; lower and upper bounds on the priors. This is useful in case there are box constraints satisfied by the priors. The posterior is guaranteed to lie within these bounds.
seed
optional; an object specifying if and how the random number generator should be initialized (seeded). If seed is an integer, it is passed to set.seed prior to any simulation and is returned as the see
verbose
logical; if TRUE, print diagnostic messages.
max.fail
The maximum number of filtering failures allowed. If the number of filtering failures exceeds this number, execution will terminate with an error.
...
currently ignored.

Value

  • A list with the following elements:
  • postA matrix containing draws from the approximate posterior distribution.
  • priorA matrix containing draws from the prior distribution (identical to params on call).
  • eff.sample.sizeA vector containing the effective number of particles at each time point.
  • cond.loglikA vector containing the conditional log likelihoods at each time point.
  • smoothThe smoothing parameter used (see above).
  • seedThe state of the random number generator at the time bsmc 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.
  • nfailThe number of filtering failures encountered.
  • loglikThe estimated log-likelihood.
  • weightsThe resampling weights for each particle.

See Also

pomp-class

Examples

Run this code
## See the vignettes for examples.

Run the code above in your browser using DataLab