sampleBTF_reg: Sampler for first or second order random walk (RW) Gaussian...

View source: R/component_samplers.R

sampleBTF_regR Documentation

Sampler for first or second order random walk (RW) Gaussian dynamic linear model (DLM)

Description

Compute one draw of the T x p state variable beta in a DLM using back-band substitution methods. This model is equivalent to the Bayesian trend filtering (BTF) model applied to p dynamic regression coefficients corresponding to the design matrix X, assuming appropriate (shrinkage/sparsity) priors for the evolution errors.

Usage

sampleBTF_reg(y, X, obs_sigma_t2, evol_sigma_t2, XtX, D = 1, chol0 = NULL)

Arguments

y

the T x 1 vector of time series observations

X

the T x p matrix of time series predictors

obs_sigma_t2

the T x 1 vector of observation error variances

evol_sigma_t2

the T x p matrix of evolution error variances

XtX

the Tp x Tp matrix of X'X (one-time cost; see ?build_XtX)

D

the degree of differencing (one or two)

chol0

(optional) the m x m matrix of initial Cholesky factorization; if NULL, use the Matrix package for sampling, otherwise use the spam package

Value

T x p matrix of simulated dynamic regression coefficients beta

Note

Missing entries (NAs) are not permitted in y. Imputation schemes are available.


drkowal/dsp documentation built on July 19, 2023, 11:42 a.m.