The general linear gaussian
state-space model can be
written in many different ways. The form considered in JD+ 3.0 is
presented below.
is the observation at period t,
is the state vector.
are assumed to be serially independent at all leads and lags and
independent from each other.
In the case of multi-variate models,
is a vector of observations. However, in most cases, we will use the
univariate approach by considering the observations one by one
(univariate handling of multi-variate models).
The innovations of the state equation will be modelled as
In other words,
The initial
()
conditions of the filter are defined as follows:
where
is arbitrary large.
is the variance of the stationary part of the initial state vector and
models the diffuse part. We write
.
The definition used in JD+ is quasi-identical to that of Durbin and
Koopman[1].
In summary, the model is completely defined by the following
quantities (possible default values are indicated in brackets):
Description of the state blocks
ar
Introduction
The auto-regressive block is defined by
where:
is an auto-regressive polynomial.
Let
be the autocovariances of the process
Using those notations, the state-space block can be written as
follows :
State block:
The state block can be extended with additional lags. That can be useful
in complex (multi-variate) models
Dynamics
Default loading
Initialization
is the unconditional covariance of the state array; it is computed by
means of the auto-covariance function of the model
R code
The “ar” block is defined by specifying the coefficients
of the ar polynomial and the innovation variance. More exactly, they
correspond to the equation
The coefficients and/or the variance can be fixed
b_ar<-ar("ar", c(.7,-.4, .2), nlags=5, variance=1)
cat("T\n")
#> T
knit_print(block_t(b_ar))
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0.7 -0.4 0.2 0 0
#> [2,] 1.0 0.0 0.0 0 0
#> [3,] 0.0 1.0 0.0 0 0
#> [4,] 0.0 0.0 1.0 0 0
#> [5,] 0.0 0.0 0.0 1 0
cat("\nP0\n")
#>
#> P0
knit_print(block_p0(b_ar))
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 1.51552795 0.77018634 0.08695652 0.05590062 0.15838509
#> [2,] 0.77018634 1.51552795 0.77018634 0.08695652 0.05590062
#> [3,] 0.08695652 0.77018634 1.51552795 0.77018634 0.08695652
#> [4,] 0.05590062 0.08695652 0.77018634 1.51552795 0.77018634
#> [5,] 0.15838509 0.05590062 0.08695652 0.77018634 1.51552795
ar2
Introduction
An alternative representation of the auto-regressive block will be
very useful for the purposes of reflecting expectations. The process is
defined as above:
where:
is an auto-regressive polynomial. However, modeling data that refers
to expectations may require including conditional expectations in the
state vector. Thus, the same type of representation that is used for the
ARMA model will be considered here.
Let
be the autocovariances of the model. We also define the size of our
state vector as
,
where
is the forecast horizon desired by the user. If the user needs to use
lagged values, whose default value is zero. Then the size of the state
vector will be
Using those notations, the state-space model can be written as
follows :
State block:
where
is the orthogonal projection of
on the subspace generated by
.
Thus, it is the forecast function with respect to the semi-infinite
sample. We also have that
Dynamics
with
for
Default loading
Initialization
is the unconditional covariance of the state array; it can be easily
derived using the MA representation. We have:
b_ar2<-ar2("ar2", c(-.2, .4, -.1), nlags=3, nfcasts=2)
knit_print(block_t(b_ar2))
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 1 0 0.0 0.0 0.0
#> [2,] 0 0 1 0.0 0.0 0.0
#> [3,] 0 0 0 1.0 0.0 0.0
#> [4,] 0 0 0 0.0 1.0 0.0
#> [5,] 0 0 0 0.0 0.0 1.0
#> [6,] 0 0 0 -0.1 0.4 -0.2
arma
Introduction
The arma block is defined by
where:
are the auto-regressive and the moving average polynomials.
The MA representation of the process is
.
Let
be the autocovariances of the model. We also define:
.
Using those notations, the state-space block can be written as
follows :
State block:
where
is the orthogonal projection of
on the subspace generated by
.Thus,
it is the forecast function with respect to the semi-infinite sample. We
also have that
Dynamics
with
for
Default loading
Initialization
is the unconditional covariance of the state array; it can be easily
derived using the MA representation. We have:
b_arma<-arma("arma", ar=c(-.2, .4, -.1), ma=c(.3, .6))
knit_print(block_t(b_arma))
#> [,1] [,2] [,3]
#> [1,] 0.0 1.0 0.0
#> [2,] 0.0 0.0 1.0
#> [3,] 0.1 -0.4 0.2
knit_print(block_p0(b_arma))
#> [,1] [,2] [,3]
#> [1,] 1.3501359 0.6394319 0.2517752
#> [2,] 0.6394319 0.3501359 0.1394319
#> [3,] 0.2517752 0.1394319 0.1001359