Learn R Programming

bssm (version 0.1.8)

run_mcmc.gssm: Bayesian Inference of Linear-Gaussian State Space Models

Description

Bayesian Inference of Linear-Gaussian State Space Models

Usage

# S3 method for gssm
run_mcmc(object, n_iter, type = "full",
  n_burnin = floor(n_iter/2), n_thin = 1, gamma = 2/3,
  target_acceptance = 0.234, S, end_adaptive_phase = TRUE,
  n_threads = 1, seed = sample(.Machine$integer.max, size = 1), ...)

# S3 method for bsm run_mcmc(object, n_iter, type = "full", n_burnin = floor(n_iter/2), n_thin = 1, gamma = 2/3, target_acceptance = 0.234, S, end_adaptive_phase = TRUE, n_threads = 1, seed = sample(.Machine$integer.max, size = 1), ...)

# S3 method for ar1 run_mcmc(object, n_iter, type = "full", n_burnin = floor(n_iter/2), n_thin = 1, gamma = 2/3, target_acceptance = 0.234, S, end_adaptive_phase = TRUE, n_threads = 1, seed = sample(.Machine$integer.max, size = 1), ...)

# S3 method for lgg_ssm run_mcmc(object, n_iter, type = "full", n_burnin = floor(n_iter/2), n_thin = 1, gamma = 2/3, target_acceptance = 0.234, S, end_adaptive_phase = TRUE, n_threads = 1, seed = sample(.Machine$integer.max, size = 1), ...)

Arguments

object

Model object.

n_iter

Number of MCMC iterations.

type

Type of output. Default is "full", which returns samples from the posterior \(p(\alpha, \theta)\). Option "summary" does not simulate states directly but computes the posterior means and variances of states using fast Kalman smoothing. This is slightly faster, memory efficient and more accurate than calculations based on simulation smoother. Using option "theta" will only return samples from the marginal posterior of the hyperparameters \(\theta\).

n_burnin

Length of the burn-in period which is disregarded from the results. Defaults to n_iter / 2. Note that all MCMC algorithms of bssm used adaptive MCMC during the burn-in period in order to find good proposal.

n_thin

Thinning rate. All MCMC algorithms in bssm use the jump chain representation, and the thinning is applied to these blocks. Defaults to 1.

gamma

Tuning parameter for the adaptation of RAM algorithm. Must be between 0 and 1 (not checked).

target_acceptance

Target acceptance ratio for RAM. Defaults to 0.234.

S

Initial value for the lower triangular matrix of RAM algorithm, so that the covariance matrix of the Gaussian proposal distribution is \(SS'\). Note that for some parameters (currently the standard deviation and dispersion parameters of bsm models) the sampling is done for transformed parameters with internal_theta = log(1 + theta).

end_adaptive_phase

If TRUE (default), $S$ is held fixed after the burnin period.

n_threads

Number of threads for state simulation.

seed

Seed for the random number generator.

...

Ignored.