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

View source: R/abco.R

t_sampleBTFR Documentation

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

Description

Compute one draw of the T state variable mu in a DLM using back-band substitution methods. This model is equivalent to the Bayesian trend filtering (BTF) model, assuming appropriate (shrinkage/sparsity) priors for the evolution errors.

Usage

t_sampleBTF(y, obs_sigma_t2, evol_sigma_t2, D = 1, loc_obs)

Arguments

y

the T x 1 vector of time series observations

obs_sigma_t2

the T x 1 vector of observation error variances

evol_sigma_t2

the T x 1 vector of evolution error variances

D

the degree of differencing (one or two)

loc_obs

list of the row and column indices to fill in a band-sparse matrix

Value

T x 1 vector of simulated states

Note

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


dsp documentation built on Aug. 21, 2025, 5:29 p.m.