10.1 State-Space Models


y = 19731 kemitor (T, x0, H, F, ErrY, ErrX)
simulates observations of a time-independent state-space model

A time-independent state-space model is defined by the two equations

$\displaystyle y_t$ $\displaystyle =$ $\displaystyle H x_t + v_t,$  
$\displaystyle x_t$ $\displaystyle =$ $\displaystyle F x_{t-1} + w_t, \quad t \in T,$  

where the first equation is called the observation equation and the second equation is called the state equation. The state $ x_t$ is assumed to be a ( $ n \times 1$) vector and the observation $ y_t$ is assumed to be a ( $ m \times 1$) vector. In practical applications, we usually work with a discrete-time model and therefore we usually take $ T$ as a set of integer numbers. The vectors $ v_t$ and $ w_t$ represent random effects and we assume that they are centered with a covariance structure given by
$\displaystyle \ E v_s v_t^T$ $\displaystyle =$ $\displaystyle \delta_{st} Q,$  
$\displaystyle \ E w_s w_t^T$ $\displaystyle =$ $\displaystyle \delta_{st} R,$  
$\displaystyle E v_s w_t^T$ $\displaystyle =$ $\displaystyle 0,$  

where the symbol $ \delta_{st}$ stands for Kronecker delta, $ Q$ and $ R$ are some covariance matrices. To have the state-space model properly defined some assumptions about the initial state must also be made. We will denote the initial state as $ x_0$ (supposing $ t \in T =
\{ 0,1,\dots \}$). Standard assumptions are
$\displaystyle \ E x_0$ $\displaystyle =$ $\displaystyle \mu,$  
$\displaystyle \ \textrm{Var} \, x_0$ $\displaystyle =$ $\displaystyle \Sigma,$  

where $ \Sigma$ is a ( $ n \times n$) covariance matrix. Both $ \mu$ and $ \Sigma$ may be known or unknown but we will assume here that $ \Sigma$ is known. Note that $ \Sigma={\boldmath0}$ corresponds to a situation when $ x_0$ is a deterministic vector.

In order to keep the state-space model reasonably simple we assume the sequence $ \{ x_0,(v^T_t,w^T_t)^T\}_{t \in T}$ to be orthogonal. The matrices $ H$, $ F$, $ Q$ and $ R$ (sometimes they are referred to as system matrices) were originally (in engineering applications) assumed to be known but in econometric applications some of them may be unknown (but we still assume they are nonstochastic).

One can easily check that the sequence $ \{ x_t \}$ has a Markovian property if the vectors in the sequence $ \{ x_0,(v^T_t,w^T_t)^T\}_{t \in T}$ are independent. This is satisfied for example in a case when $ \{v_t \}$ and $ \{w_t \}$ are Gaussian errors (the model is then said to be Gaussian).

The state-space models include most of the well-known time series and linear models. In the following examples state representations of Holt-Winters method and ARMA($ p,q$) model are introduced.


10.1.1 Examples of State-Space Models

The state-space equivalent of the Holt-Winters method has the form

$\displaystyle S_t$ $\displaystyle =$ $\displaystyle S_{t-1} + T_{t-1} + \delta S_t,$  
$\displaystyle T_t$ $\displaystyle =$ $\displaystyle T_{t-1} + \delta T_t,$  
$\displaystyle I_t$ $\displaystyle =$ $\displaystyle -\sum_{i=1}^{p-1} I_{t-1} + \delta I_t,$  
$\displaystyle y_t$ $\displaystyle =$ $\displaystyle S_t + I_t + \varepsilon_t.$  

The random variables $ \delta S_t$, $ \delta T_t$, $ \delta I_t$ and $ \varepsilon_t$ are assumed to be white noise and mutually uncorrelated. Note that the random components $ \delta S_t$, $ \delta T_t$ and $ \delta I_t$ are not present in the classical form of the method and they represent wider abilities of state-space representation of the method.

ARMA( $ \boldsymbol{p,q}$) model

$\displaystyle X_t - \phi_1 X_{t-1} - \dots - \phi_p X_{t-p} =
\ \varepsilon_t +...
... \varepsilon_{t-1} +
\ \dots + \theta_q \varepsilon_{t-q}, \ t=0,\pm 1, \dots $

when $ \{ \varepsilon_t \}$ is a white noise and has also a state-space representation. Denoting

$\displaystyle m=\max \, (p,q+1), \quad \phi_j=0 \quad {\rm for} \ j>p, \quad
\ \theta_j=0 \quad {\rm for} \ j>q$

and

$\displaystyle x_t=\left[\begin{array}{cccc}
\ X_t &
\ X_{t-1} &
\ \dots &
\ X_{t-m+1}
\end{array}\right]\,,
$

the state-space form of an ARMA($ p,q$) is
$\displaystyle y_t$ $\displaystyle =$ $\displaystyle \left[ \begin{array}{cccc}
1 & 0 & \dots & 0
\end{array}\right] \, x_t\,,$  
$\displaystyle x_t$ $\displaystyle =$ $\displaystyle \left[\begin{array}{ccccc}
\phi_1 & 1 & 0 & \dots & 0 \\
\phi_2 ...
...ta_1 \\
\dots \\
\theta_{m-1}
\end{array}\right] \, \varepsilon_t, \ t \in T.$  

More detailed information about state-space models may be found for example in Harvey (1990).


10.1.2 Modeling State-Space Models in XploRe

Time-invariant state-space models can be easily simulated using the XploRe quantlet 19916 kemitor . One hundred observations of the state-space model

$\displaystyle y_t$ $\displaystyle =$ $\displaystyle \left[ \begin{array}{cc}
1 & 0
\end{array}\right] \, x_t + v_t,$  
$\displaystyle x_t$ $\displaystyle =$ $\displaystyle \left[\begin{array}{cc}
0.5 & -0.3 \\
1 & 0
\end{array}\right] \, x_{t-1} +
\left[\begin{array}{c}
w_t \\
0
\end{array}\right],$  

with $ x_0=0$, $ v_t \sim N(0,4)$ and $ w_t \sim N(0,1)$ may be simulated with the following set of instructions:
  library("times")
  T = 100
  randomize(0)
  ex = normal(T)~(vec(1:T).*0)
  ey = normal(T).*2
  H = 1~0 
  F = #(0.5,1)~#(-0.3,0)
  x0 = #(0,0)
  ar2 = kemitor(T,x0,H,F,ey,ex)
19920 XLGkalm01.xpl

Note that this time series corresponds to an AR(2) process

$\displaystyle y_t = 0.5 \, y_{t-1} - 0.3 \, y_{t-2} + \varepsilon_t
$

with additive Gaussian noise.

The fact that the errors are pregenerated and supplied as parameters of the quantlet allows us to model errors with distributions different from the Gaussian one or error terms with some special interdependencies. In this framework, it is for example possible to model easily time series with different kinds of outliers.