sampleBTF_reg_backfit: (Backfitting) Sampler for first or second order random walk...

View source: R/component_samplers.R

sampleBTF_reg_backfitR Documentation

(Backfitting) 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. The sampler here uses a backfitting method that draws each predictor j=1,...,p conditional on the other predictors (and coefficients), which leads to a faster O(Tp) algorithm. However, the MCMC may be less efficient.

Usage

sampleBTF_reg_backfit(y, X, beta, obs_sigma_t2, evol_sigma_t2, D = 1)

Arguments

y

the T x 1 vector of time series observations

X

the T x p matrix of time series predictors

beta

the T x p matrix of previous dynamic regression coefficients

obs_sigma_t2

the T x 1 vector of observation error variances

evol_sigma_t2

the T x p matrix of evolution error variances

D

the degree of differencing (one or two)

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.