regMod: Create a standard regression component for an exDQLM

View source: R/regMod.R

regModR Documentation

Create a standard regression component for an exDQLM

Description

The function constructs a regression block where the observation vector at time t is F_t = X_t (row of the design matrix), and the state evolves as \theta_t = \theta_{t-1} (i.e., G_t = I_n).

Usage

regMod(X, m0, C0)

Arguments

X

A numeric matrix of dimension T \times n (T time points, n regressors). Vectors are accepted and treated as T \times 1.

m0

Optional numeric prior mean (length n). Defaults to zeros.

C0

Optional numeric prior covariance (n \times n). Defaults to 10^3 I_n.

Details

Input X is a T \times n matrix of regressors; the returned FF is an n \times T matrix (i.e., t(X)), consistent with component composition via +.exdqlm.

Value

An object of class "exdqlm" with elements:

  • FF - n \times T matrix with column t equal to F_t = X_t.

  • GG - n \times n identity matrix (static coefficients).

  • m0, C0 - Prior mean/covariance for regression coefficients.

Examples

data("climateIndices", package = "exdqlm")

T <- 150
bt_dates <- seq(as.Date("1987-01-01"), by = "month", length.out = T)
idx <- match(bt_dates, climateIndices$date)
X <- scale(climateIndices[idx, c("noi", "amo")])

# Single regressor (T x 1)
reg1 = regMod(X[, "noi"])
# Multiple regressors (T x n)
reg2 = regMod(X)

# Combine with trend/seasonal components
trend.comp = polytrendMod(order = 3, m0 = rep(0,3), C0 = diag(3))
seas.comp  = seasMod(p = 12, h = 1, C0 = diag(1, 2))
base.mod   = trend.comp + seas.comp
model.std  = base.mod + reg2

exdqlm documentation built on June 5, 2026, 1:06 a.m.