Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expand_sample

Expand the Jump Chain representation


Description

The MCMC algorithms of bssm use a jump chain representation where we store the accepted values and the number of times we stayed in the current value. Although this saves bit memory and is especially convenient for IS-corrected MCMC, sometimes we want to have the usual sample paths. Function expand_sample returns the expanded sample based on the counts. Note that for IS-corrected output the expanded sample corresponds to the approximate posterior.

Usage

expand_sample(x, variable = "theta", times, states, by_states = TRUE)

Arguments

x

Output from run_mcmc.

variable

Expand parameters "theta" or states "states".

times

Vector of indices. In case of states, what time points to expand? Default is all.

states

Vector of indices. In case of states, what states to expand? Default is all.

by_states

If TRUE (default), return list by states. Otherwise by time.


bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.