Compute the quadratic term arising in the full conditional distribution
of a Bayesian trend filtering model with D = 1
or D = 2
.
This function exploits the known D
-banded structure of Q
to compute the matrix directly, using objects in the Matrix package.
build_Q(obs_sigma_t2, evol_sigma_t2, D = 1)
Banded T x T
Matrix (object) Q
the T x 1
vector of observation error variances
the T x 1
vector of evolution error variances
the degree of differencing (one or two)