Description Usage Arguments Details See Also
Function structSSM
creates a state space
representation of structural time series.
1 2 3 4 5 6 7 | 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)
|
trend |
A character vector defining the type of the
level component of the model. For multivariate series,
either one type, it is assumed that all p series
have same type of trend components. Possible values are
|
seasonal |
A character vector defining the type of
the seasonal component of the model. For multivariate
series, it is assumed that all p series have same
type of seasonal components. Possible values are
|
X |
A n*k matrix of explanatory variables, with each column containing one explanatory variable. It is assumed that all p series use same explanatory variables. |
H |
A p*p covariance matrix (or p*p*n array in time-varying case) of the disturbance terms ε[t] of the observation equation. Default gives p*p zero matrix. Omitted in case of non-Gaussian distributions. Augment the state vector if you want to add additional noise. |
Q.level |
A scalar or p*p covariance matrix (or p*p*n array in time-varying case) of the disturbance terms ξ[t] corresponding to the level process μ[t]. Default gives diagonal matrix with NA's on diagonal. |
Q.slope |
A scalar or p*p
covariance matrix (or p*p*n
array in time-varying case) of the disturbance terms
ξ[t] corresponding to the slope process
ν[t]. Default gives diagonal matrix with
NA's on diagonal. Omitted if |
Q.seasonal |
scalar or A p*p
covariance matrix (or p*p*n
array in time-varying case) of the disturbance terms
ω[t] corresponding to the seasonal
process γ[t]. Default gives
diagonal matrix with NA's on diagonal. Omitted if
|
Q.regression |
A scalar or xn*xn covariance matrix (or xn*xn*n array in time-varying case) of the disturbance terms corresponding to the regression coefficient processes. Default gives zero matrix i.e. ordinary time-invariant regression. |
y |
A time series object of class |
u |
Only used with non-Gaussian distribution. See details. |
distribution |
Specify the distribution of the observations. Default is "Gaussian". |
transform |
The functions of |
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. |
The structural time series model has form
y[t] = μ[t] + ε[t], ε[t] ~ N(0, H[t])
μ[t+1] = μ[t] + ν[t] + ξ[t], ξ[t] ~ N(0, Q[level,t])
ν[t+1] = ν[t] + ζ[t], ζ[t] ~ N(0, Q[slope,t])
with seasonal component being either time domain form
γ[t+1] = -γ[t] - … - γ[t-s+2] + ω[t], ω[t] ~ N(0,Q[seasonal,t]),
or frequency domain form where
γ[t] = γ[1,t] + … + γ[[s/2],t],
γ_{j,t+1} = γ[j,t] cosλ[j] + γ*[j,t] sinλ[j] + ω[j,t],
γ*[j,t+1] = - γ[j,t] sinλ[j] + γ*[j,t] cosλ[j] + ω*[j,t], j=1,..., [s/2],
with ω[j,t] and ω*[j,t] being independently distributed variables with N(0, Q[seasonal,t]) distribution and λ[j] = 2π 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.