structSSM
creates a state space
representation of structural time series.structSSM(y, trend = "level", seasonal = "none",
X = NULL, H = NULL, Q.level = NULL, Q.slope = NULL,
Q.seasonal = NULL, Q.regression = 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)
"level"
(local level model) "none"
(no seasonal), "time"
ts
, or a
object that can be coerced to such.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$$y_t = \mu_t + \gamma_t + \epsilon_t, \quad \epsilon_t ~ N(0, H_t)$$
$$\mu_{t+1} = \mu_t + \nu_t + \xi_t, \quad \xi_t ~ N(0, Q_{level,t})$$
$$\nu_{t+1} = \nu_t + \zeta_t, \quad \zeta_t ~ N(0, Q_{slope,t})$$
with seasonal component being either time domain form $$\gamma_{t+1} = -\sum_{j=1}^{s-1}\gamma_{t+1-j} + \omega_t, \quad \omega_t ~ N(0,Q_{seasonal,t}),$$
or frequency domain form where
$$\gamma_{t} = \sum_{j=1}^{\lfloor s/2 \rfloor}\gamma_{j,t}$$ $$\gamma_{j,t+1} = \gamma_{j,t} cos\lambda_j + \gamma^{\ast}_{j,t} sin\lambda_j + \omega_{j,t},$$ $$\gamma^{\ast}_{j,t+1} = - \gamma_{j,t} sin\lambda_j + \gamma^{\ast}_{j,t} cos\lambda_j + \omega^\ast_{j,t}, j=1,\ldots, \lfloor s/2 \rfloor,$$ with $\omega_{j,t}$ and $\omega^\ast_{j,t}$ being independently distributed variables with $N(0, Q_{seasonal,t})$ distribution and $\lambda_j = 2\pi j/s$.
Explanatory variables can also be added to the model; in
structSSM
function it is assumed that same
explanatory variables are used for all series. See
regSSM
and +
for more
complicated settings.
arimaSSM
for state space representation of
ARIMA model, regSSM
for state space
representation of a regression model,
SSModel
for custom SSModel
object
and KFAS
for general information regarding
the package and examples of its usage.