bsmc2 {pomp} | R Documentation

## The Liu and West Bayesian particle filter

### Description

Modified version of the Liu and West (2001) algorithm.

### Usage

    ## S4 method for signature 'data.frame'
    bsmc2(data, Np, smooth = 0.1, tol = 1e-17,
      max.fail = 0, params, rprior, rinit, rprocess, dmeasure, partrans, ...,
      verbose = getOption("verbose", FALSE))

    ## S4 method for signature 'pomp'
    bsmc2(data, Np, smooth = 0.1, tol = 1e-17,
      max.fail = 0, ..., verbose = getOption("verbose", FALSE))

### Arguments

`data` | either a data frame holding the time series data, or an object of class ‘pomp’, i.e., the output of another pomp calculation.
`Np` | number of particles
`smooth` | Kernel density smoothing parameter. The compensating shrinkage factor will be `sqrt(1-smooth^2)`. Thus, `smooth=0` means that no noise will be added to parameters. The general recommendation is that the value of `smooth` should be chosen close to 0 (e.g., `shrink` ~ 0.1).
`tol` | positive numeric scalar; particles with likelihood less than `tol` are considered to be incompatible with the data. See the section on Filtering Failures for more information.
`max.fail` | integer; the maximum number of filtering failures allowed (see below). If the number of filtering failures exceeds this number, execution will terminate with an error. By default, `max.fail` is set to infinity, so no error can be triggered.
`params` | optional; named numeric vector of parameters. This will be coerced internally to storage mode `double`.
`rprior` | optional; prior distribution sampler, specified either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library. For more information, see ?prior_spec. Setting `rprior=NULL` removes the prior distribution sampler.
`rinit` | simulator of the initial-state distribution. This can be furnished either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library. Setting `rinit=NULL` sets the initial-state simulator to its default. For more information, see ?rinit_spec.
`rprocess` | simulator of the latent state process, specified using one of the rprocess plugins. Setting `rprocess=NULL` removes the latent-state simulator. For more information, see ?rprocess_spec for the documentation on these plugins.
`dmeasure` | evaluator of the measurement model density, specified either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library. Setting `dmeasure=NULL` removes the measurement density evaluator. For more information, see ?dmeasure_spec.

`partrans`

optional parameter transformations, constructed using `parameter_trans`.

Many algorithms for parameter estimation search an unconstrained space of parameters. When working with such an algorithm and a model for which the parameters are constrained, it can be useful to transform parameters. One should supply the `partrans` argument via a call to `parameter_trans`. For more information, see ?parameter_trans. Setting `partrans=NULL` removes the parameter transformations, i.e., sets them to the identity transformation.

`...`

additional arguments supply new or modify existing model characteristics or components. See `pomp` for a full list of recognized arguments.

When named arguments not recognized by `pomp` are provided, these are made available to all basic components via the so-called userdata facility. This allows the user to pass information to the basic components outside of the usual routes of covariates (`covar`) and model parameters (`params`). See ?userdata for information on how to use this facility.

`verbose` | logical; if `TRUE`, diagnostic messages will be printed to the console.

### Details

`bsmc2` uses a version of the original algorithm (Liu \& West 2001), but discards the auxiliary particle filter. The modification appears to give superior performance for the same amount of effort.

Samples from the prior distribution are drawn using the `rprior` component. This is allowed to depend on elements of `params`, i.e., some of the elements of `params` can be treated as “hyperparameters”. `Np` draws are made from the prior distribution.

### Value

An object of class ‘bsmcd_pomp’. The following methods are avaiable:

`plot`

  produces diagnostic plots

`as.data.frame`

  puts the prior and posterior samples into a data frame

### Filtering failures

If the degree of disagreement between model and data becomes sufficiently large, a “filtering failure” results. A filtering failure occurs when, at some time point, none of the `Np` particles is compatible with the data. In particular, if the conditional likelihood of a particle at any time is below the tolerance value `tol`, then that particle is considered to be uninformative and its likelihood is taken to be zero. A filtering failure occurs when this is the case for all particles. A warning is generated when this occurs unless the cumulative number of failures exceeds `max.fail`, in which case an error is generated.

### Author(s)

Michael Lavine, Matthew Ferrari, Aaron A. King, Edward L. Ionides

### References

Liu, J. and M. West. Combining Parameter and State Estimation in Simulation-Based Filtering. In A. Doucet, N. de Freitas, and N. J. Gordon, editors, Sequential Monte Carlo Methods in Practice, pages 197-224. Springer, New York, 2001.

### See Also

Other particle filter methods: `cond.logLik`, `eff.sample.size`, `filter.mean`, `filter.traj`, `mif2`, `pfilter`, `pmcmc`, `pred.mean`, `pred.var`

Other pomp parameter estimation methods: `abc`, `kalman`, `mif2`, `nlf`, `pmcmc`, `pomp-package`, `probe.match`, `spect.match`

[Package pomp version 2.3 Index]