Learn R Programming

KFAS (version 0.9.9)

regSSM: Create a State Space Model Representation of Linear Regression Model

Description

Function regSSM creates a state space representation of linear regression model.

Usage

regSSM(y, X, H = NULL, Q = NULL, u = NULL,
    distribution = c("Gaussian", "Poisson", "Binomial"),
    transform = c("none", "ldl", "augment"),
    tolF = .Machine$double.eps^0.5,
    tol0 = .Machine$double.eps^0.5)

Arguments

X
A $n \times k$ matrix of explanatory variables, with each column containing one explanatory variable, or a list of length $p$ containing $X$ matrices for each series. If X is matrix, it is assumed that all $p$ series use same explanatory variables
H
A $p \times p$ covariance matrix (or $p \times p \times n$ array in of time-varying case) of the disturbance terms $\epsilon_t$ of the observation equation. Default gives $p \times p$ zero matrix. Omitted in case of non-Gaussian distributions.
Q
A $r \times r$ (or $r \times r \times n$ array in of time-varying case) covariance matrix of the disturbance terms $\eta_t$ of the system equation. Default is $m \times m$ zero matrix ie. ordinary time-invariant regression.
y
A time series object of class ts, or a object that can be coerced to such.
u
Only used with non-Gaussian distribution. See details.
distribution
Specify the distribution of the observations. Default is "Gaussian".
transform
The functions of KFAS require diagonal covariance matrix $H_t$. If $H_t$ is not diagonal, model can be transformed using one of the two options. Option "ldl" performs LDL decomposition for covariance matrix $H_t$, and m
tolF
Tolerance parameter for Finf. Smallest value not counted for zero.
tol0
Tolerance parameter for LDL decomposition, determines which diagonal values are counted as zero.

Details

The linear Gaussian state space model is given by

$$y_t = X_t \beta_t + \epsilon_t,$$

$$\alpha_{t+1} = T_t \alpha_t + R_t \eta_t,$$

where $\epsilon_t ~ N(0,H_t)$, $\eta_t ~ N(0,Q_t)$ and $\alpha_1 ~ N(a_1,P_1)$ independently of each other. In case of non-Gaussian observations, the observation equation is of form $p(y_t|\theta_t) = p(y_t|Z_t\alpha_t)$, with $p(y_t|\theta_t)$ being one of the following:

See Also

arimaSSM for state space representation of ARIMA model, structSSM for structural time series model, and SSModel for custom SSModel object.