buildAuxiliaryFilter: Create an auxiliary particle filter algorithm to estimate... In nimbleSMC: Sequential Monte Carlo Methods for 'nimble'

Description

Create an auxiliary particle filter algorithm for a given NIMBLE state space model.

Usage

 1 buildAuxiliaryFilter(model, nodes, control = list())

Arguments

 model A NIMBLE model object, typically representing a state space model or a hidden Markov model. nodes A character vector specifying the latent model nodes over which the particle filter will stochastically integrate to estimate the log-likelihood function. All provided nodes must be stochastic. Can be one of three forms: a variable name, in which case all elements in the variable are taken to be latent (e.g., 'x'); an indexed variable, in which case all indexed elements are taken to be latent (e.g., 'x[1:100]' or 'x[1:100, 1:2]'); or a vector of multiple nodes, one per time point, in increasing time order (e.g., c("x[1:2, 1]", "x[1:2, 2]", "x[1:2, 3]", "x[1:2, 4]")). control A list specifying different control options for the particle filter. Options are described in the details section below.

Details

Each of the control() list options are described in detail here:

The lookahead function used to calculate auxiliary weights. Can choose between 'mean' and 'simulate'. Defaults to 'simulate'.

resamplingMethod

The type of resampling algorithm to be used within the particle filter. Can choose between 'default' (which uses NIMBLE's rankSample() function), 'systematic', 'stratified', 'residual', and 'multinomial'. Defaults to 'default'. Resampling methods other than 'default' are currently experimental.

saveAll

Indicates whether to save state samples for all time points (TRUE), or only for the most recent time point (FALSE)

smoothing

Decides whether to save smoothed estimates of latent states, i.e., samples from f(x[1:t]|y[1:t]) if smoothing = TRUE, or instead to save filtered samples from f(x[t]|y[1:t]) if smoothing = FALSE. smoothing = TRUE only works if saveAll = TRUE.

timeIndex

An integer used to manually specify which dimension of the latent state variable indexes time. This need only be set if the number of time points is less than or equal to the size of the latent state at each time point.

initModel

A logical value indicating whether to initialize the model before running the filtering algorithm. Defaults to TRUE.

The auxiliary particle filter modifies the bootstrap filter (buildBootstrapFilter) by adding a lookahead step to the algorithm: before propagating particles from one time point to the next via the transition equation, the auxiliary filter calculates a weight for each pre-propogated particle by predicting how well the particle will agree with the next data point. These pre-weights are used to conduct an initial resampling step before propagation.

The resulting specialized particle filter algorthm will accept a single integer argument (m, default 10,000), which specifies the number of random \'particles\' to use for estimating the log-likelihood. The algorithm returns the estimated log-likelihood value, and saves unequally weighted samples from the posterior distribution of the latent states in the mvWSamples modelValues object, with corresponding logged weights in mvWSamples['wts',]. An equally weighted sample from the posterior can be found in the mvEWsamp modelValues object.

The auxiliary particle filter uses a lookahead function to select promising particles before propagation. This function can eithre be the expected value of the latent state at the next time point (lookahead = 'mean') or a simulation from the distribution of the latent state at the next time point (lookahead = 'simulate'), conditioned on the current particle.

@section returnESS() Method: Calling the returnESS() method of an auxiliary particle filter after that filter has been run() for a given model will return a vector of ESS (effective sample size) values, one value for each time point.

Nicholas Michaud

References

Pitt, M.K., and Shephard, N. (1999). Filtering via simulation: Auxiliary particle filters. Journal of the American Statistical Association 94(446): 590-599.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7108878,"math_prob":0.9522657,"size":4940,"snap":"2022-05-2022-21","text_gpt3_token_len":1249,"char_repetition_ratio":0.115883306,"word_repetition_ratio":0.02457956,"special_character_ratio":0.25850204,"punctuation_ratio":0.14207049,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96857333,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-22T06:38:53Z\",\"WARC-Record-ID\":\"<urn:uuid:29131a77-5493-4477-bd0b-fec8633a65aa>\",\"Content-Length\":\"42800\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a040fa7a-7434-4a8c-a77d-f2e1077d2839>\",\"WARC-Concurrent-To\":\"<urn:uuid:1a60c878-17a2-48f3-b032-517e97527bc2>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/nimbleSMC/man/buildAuxiliaryFilter.html\",\"WARC-Payload-Digest\":\"sha1:CLEY6GOW2FRMNGOTQOA6PQJX6CUGBAAS\",\"WARC-Block-Digest\":\"sha1:D4G6Z7QUY36QTGUTXNSSI5ZU67ZB4ZZX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320303747.41_warc_CC-MAIN-20220122043216-20220122073216-00111.warc.gz\"}"}