bsmc2 | R Documentation |

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

```
## S4 method for signature 'data.frame'
bsmc2(
data,
Np,
smooth = 0.1,
params,
rprior,
rinit,
rprocess,
dmeasure,
partrans,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'pomp'
bsmc2(data, Np, smooth = 0.1, ..., verbose = getOption("verbose", FALSE))
```

`data` |
either a data frame holding the time series data,
or an object of class ‘pomp’,
i.e., the output of another pomp calculation.
Internally, |

`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 length(time(object,t0=TRUE)) or as a function taking a positive integer argument.
In the latter case, |

`smooth` |
Kernel density smoothing parameter.
The compensating shrinkage factor will be |

`params` |
optional; named numeric vector of parameters.
This will be coerced internally to storage mode |

`rprior` |
optional; prior distribution sampler, specified either as a C snippet, an |

`rinit` |
simulator of the initial-state distribution.
This can be furnished either as a C snippet, an |

`rprocess` |
simulator of the latent state process, specified using one of the rprocess plugins.
Setting |

`dmeasure` |
evaluator of the measurement model density, specified either as a C snippet, an |

`partrans` |
optional parameter transformations, constructed using 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 |

`...` |
additional arguments are passed to |

`verbose` |
logical; if |

`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.

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

Some Windows users report problems when using C snippets in parallel computations.
These appear to arise when the temporary files created during the C snippet compilation process are not handled properly by the operating system.
To circumvent this problem, use the `cdir`

and `cfile`

options to cause the C snippets to be written to a file of your choice, thus avoiding the use of temporary files altogether.

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

More on Bayesian methods:
`abc()`

,
`dprior()`

,
`pmcmc()`

,
`prior_spec`

,
`rprior()`

More on full-information (i.e., likelihood-based) methods:
`mif2()`

,
`pfilter()`

,
`pmcmc()`

,
`wpfilter()`

More on sequential Monte Carlo methods:
`cond_logLik()`

,
`eff_sample_size()`

,
`filter_mean()`

,
`filter_traj()`

,
`kalman`

,
`mif2()`

,
`pfilter()`

,
`pmcmc()`

,
`pred_mean()`

,
`pred_var()`

,
`saved_states()`

,
`wpfilter()`

More on pomp estimation algorithms:
`abc()`

,
`estimation_algorithms`

,
`mif2()`

,
`nlf`

,
`pmcmc()`

,
`pomp-package`

,
`probe_match`

,
`spect_match`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.