Compute one draw of the p x 1
B-spline basis coefficients beta
in a DLM using
back-band substitution methods. The coefficients are penalized with a prior on the D = 0, D = 1, or
D = 2 differences. This model is equivalent to the Bayesian trend filtering (BTF) model
applied to p x 1
vector of equally-spaced B-spline coefficients, with the basis matrix
serving as a design matrix in the observation equation.
sampleBTF_bspline(
y,
X,
obs_sigma2,
evol_sigma_t2,
XtX_bands,
Xty = NULL,
D = 1
)
p x 1
vector of simulated basis coefficients beta
the T x 1
vector of time series observations
the T x p
basis matrix
the scalar observation error variance
the p x 1
vector of evolution error variances
list with 4 vectors consisting of the 4-bands of XtX = crossprod(X) (one-time cost)
the p x 1
matrix crossprod(X,y), which is a one-time cost (assuming no missing entries in y)
the degree of differencing (zero, one, or two)