Description Usage Arguments Details Value See Also
Function SSModel creates a state space object
object of class SSModel which can be used as an
input object for various functions of KFAS
package.
1 2 3 4 5 6 |
y |
A time series object of class |
Z |
System matrix or array of observation equation. |
H |
Covariance matrix or array of disturbance terms ε[t] of observation equation. Omitted in case of non-Gaussian distributions. Augment the state vector if you want to add additional noise. |
T |
System matrix or array of transition equation. |
R |
System matrix or array of transition equation. |
Q |
Covariance matrix or array of disturbance terms η[t]. |
a1 |
Expected value of the initial state vector α[1]. |
P1 |
Covariance matrix of α[1]. In the diffuse case the non-diffuse part of P[1]. |
P1inf |
Diffuse part of P[1]. Diagonal matrix with ones on diagonal elements which correspond to the unknown initial states. |
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 custom state space model is constructed by using the
given system matrices Z, H, T,
R, Q, a1, P1 and
P1inf. Matrix or scalar Z (array in case of
time-varying Z) is used to determine the number of
states m. If some of the other elements of the
object are missing, SSModel uses default values
which are identity matrix for T, R (or
k first columns of identity matrix) and
P1inf, and zero matrix for H, Q,
P1 and , a1. If P1 is given and
P1inf is not, the it is assumed to be zero matrix.
If Q is given, it is used to define r, the
dimensions of Q, which can be smaller than m
(defaults to m).
The linear Gaussian state space model is given by
y[t] = Z[t]α[t] + ε[t], (observation equation)
α[t+1] = T[t]α[t] + R[t]η[t], (transition equation)
where ε[t] ~ N(0,H[t]), η[t] ~ N(0,Q[t]) and α[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]|θ[t]) = p(y[t]|Z[t]α[t]), with p(y[t]|θ[t]) being one of the following:
If observations are Poisson distributed, parameter of Poisson distribution is u[t]λ[t] and θ[t]=log(λ[t]).
If observations are from binomial distribution, u is a vector specifying number the of trials at times 1,…,n, and θ[t] = log(π[t]/(1-π[t])), where pi[t] is the probability of success at time t.
For non-Gaussian models u[t]=1 as a default. For Gaussian models, parameter is omitted.
Only univariate observations are supported when observation equation is non-Gaussian.
object of class SSModel with elements
arimaSSM for state space representation of
ARIMA model, regSSM for state space
representation of a regression model, and
structSSM for structural time series model.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.