| regMod | R Documentation |
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).
regMod(X, m0, C0)
X |
A numeric matrix of dimension |
m0 |
Optional numeric prior mean (length n). Defaults to zeros. |
C0 |
Optional numeric prior covariance ( |
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.
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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.