build_Q: Compute the quadratic term in Bayesian trend filtering

build_QR Documentation

Compute the quadratic term in Bayesian trend filtering

Description

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.

Usage

build_Q(obs_sigma_t2, evol_sigma_t2, D = 1)

Arguments

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)

Value

Banded T x T Matrix (object) Q


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