KALCVF Call
- CALL KALCVF( pred, vpred, filt, vfilt, data, lead,
a, f, b, h,
- var <, z0, vz0>);
The KALCVF call computes the one-step prediction
and the filtered estimate
, as well as their covariance matrices.
The call uses forward recursions, and you
can also use it to obtain k-step estimates.
The inputs to the KALCVF subroutine are as follows:
- data
- is a T ×Ny matrix containing data
(y1, ... , yT)'.
- lead
- is the number of steps to forecast after the end of the data.
- a
- is an Nz ×1 vector for a time-invariant input vector in
the transition equation, or a (T+ lead)Nz ×1
vector containing input vectors in the transition equation.
- f
- is an Nz ×Nz matrix for a time-invariant
transition matrix in the transition equation, or a
(T+ lead)Nz ×Nz matrix containing
transition matrices in the transition equation.
- b
- is an Ny ×1 vector for a time-invariant input vector in
the measurement equation, or a (T+ lead)Ny ×1
vector containing input vectors in the measurement equation.
- h
- is an Ny ×Nz matrix for a time-invariant
measurement matrix in the measurement equation, or a
(T+ lead)Ny ×Nz matrix containing
measurement matrices in the measurement equation.
- var
- is an (Ny + Nz) ×(Ny + Nz) matrix for a
time-invariant variance matrix for the error in the transition
equation and the error in the measurement equation, or a
(T+ lead)(Ny + Nz) ×(Ny + Nz) matrix
containing variance matrices for the error in the transition
equation and the error in the measurement equation,
that is,
.
- z0
- is an optional 1 ×Nz initial
state vector
.
- vz0
- is an optional Nz ×Nz covariance
matrix of an initial state vector
.
The KALCVF call returns the following values:
- pred
- is a (T+ lead) ×Nz matrix containing
one-step predicted state vectors
.
- vpred
- is a (T+ lead)Nz ×Nz matrix
containing mean square errors of predicted state
vectors
.
- filt
- is a T ×Nz matrix containing filtered state
vectors
.
- vfilt
- is a TNz ×Nz matrix containing mean square errors of
filtered state vectors
.
The KALCVF call computes the conditional expectation of the
state vector zt given the observations, assuming that the
mean and the variance of the initial state vector are known.
The filtered value is the conditional expectation of the
state vector zt given the observations up to time t.
For k-step forecasting where k>0, the conditional expectation
at time t+k is computed given observations up to t.
For notation, Vt and Rt are variances of
and
, respectively, and Gt
is a covariance of
and
.A- stands for the generalized inverse of A.
The filtered value and its covariance matrix are
denoted
and
, respectively.
For k>0,
and
stand for the
k-step forecast of zt+k and its mean square error.
The Kalman filtering algorithm for one-step
prediction and filtering is given as follows:
![\hat{\epsilon}_t & = & y_t - b_t - H_t z_{t| t-1} \
D_t & = & H_t P_{t| t-1} H^...
...hat{\epsilon}_t \
P_{t+1| t} & = & F_t P_{t| t-1}F^'_t + V_t -
K_t D_t K^'_t](images/i17eq121.gif)
And for k-step forecasting for k>1,
![z_{t+k| t} & = & a_{t+k-1} + F_{t+k-1} z_{t+k-1| t} \
P_{t+k| t} & = & F_{t+k-1} P_{t+k-1| t}
F^'_{t+k-1} + V_{t+k-1}](images/i17eq122.gif)
When you use the alternative transition equation
![z_t = a_t + F_t{z}_{t-1} + \eta_t](images/i17eq123.gif)
the forward recursion algorithm is written
![\hat{\epsilon}_t & = & y_t - b_t - H_t{z}_{t| t-1} \
D_t & = & H_t P_{t| t-1} H...
...}_t \
P_{t+1| t} & = & F_{t+1} P_{t| t-1}F^'_{t+1} +
V_{t+1} - K_t D_t K^'_t](images/i17eq124.gif)
And for k-step forecasting (k>1),
![z_{t+k| t} & = & a_{t+k} + F_{t+k}z_{t+k-1| t} \
P_{t+k| t} & = & F_{t+k} P_{t+k-1| t} F^'_{t+k} +
V_{t+k}](images/i17eq125.gif)
You can use the KALCVF call when you specify the
alternative transition equation and Gt = 0.
The initial state vector and its covariance
matrix of the time invariant Kalman filters
are computed under the stationarity condition
![z_{1|} & = & (I- F)^- a\
P_{1|} & = & (I- F\otimes F)^- {vec}(V)](images/i17eq126.gif)
where F and V are the time invariant transition
matrix and the covariance matrix of transition equation noise,
and vec(V) is an Nz2 ×1 column vector that is
constructed by the stacking Nz columns of matrix V.
Note that all eigenvalues of the matrix F are
inside the unit circle when the SSM is stationary.
When the preceding formula cannot be applied, the initial
state vector estimate
is set to a1 and
its covariance matrix
is given by 106I.
Optionally, you can specify initial values.
The KALCVF call allows missing values in observations.
If there is a missing observation, the filtered state vector
for the missing observation is given by the one-step forecast.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.