## 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* ×*N*_{y} matrix containing data
(**y**_{1}, ... , **y**_{T})'.

*lead*
- is the number of steps to forecast after the end of the data.

*a*
- is an
*N*_{z} ×1 vector for a time-invariant input vector in
the transition equation, or a (*T*+ lead)*N*_{z} ×1
vector containing input vectors in the transition equation.

*f*
- is an
*N*_{z} ×*N*_{z} matrix for a time-invariant
transition matrix in the transition equation, or a
(*T*+ lead)*N*_{z} ×*N*_{z} matrix containing
transition matrices in the transition equation.

*b*
- is an
*N*_{y} ×1 vector for a time-invariant input vector in
the measurement equation, or a (*T*+ lead)*N*_{y} ×1
vector containing input vectors in the measurement equation.

*h*
- is an
*N*_{y} ×*N*_{z} matrix for a time-invariant
measurement matrix in the measurement equation, or a
(*T*+ lead)*N*_{y} ×*N*_{z} matrix containing
measurement matrices in the measurement equation.

*var*
- is an (
*N*_{y} + *N*_{z}) ×(*N*_{y} + *N*_{z}) 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)(*N*_{y} + *N*_{z}) ×(*N*_{y} + *N*_{z}) matrix
containing variance matrices for the error in the transition
equation and the error in the measurement equation,
that is, .

*z*0
- is an optional 1 ×
*N*_{z} initial
state vector .

*vz*0
- is an optional
*N*_{z} ×*N*_{z} covariance
matrix of an initial state vector .

The KALCVF call returns the following values:
*pred*
- is a (
*T*+ lead) ×*N*_{z} matrix containing
one-step predicted state vectors .

*vpred*
- is a (
*T*+ lead)*N*_{z} ×*N*_{z} matrix
containing mean square errors of predicted state
vectors .

*filt*
- is a
*T* ×*N*_{z} matrix containing filtered state
vectors .

*vfilt*
- is a
*TN*_{z} ×*N*_{z} matrix containing mean square errors of
filtered state vectors .

The KALCVF call computes the conditional expectation of the
state vector **z**_{t} 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 **z**_{t} 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, **V**_{t} and **R**_{t} are variances of
and , respectively, and **G**_{t}
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 **z**_{t+k} and its mean square error.
The Kalman filtering algorithm for one-step
prediction and filtering is given as follows:

And for *k*-step forecasting for *k*>1,

When you use the alternative transition equation

the forward recursion algorithm is written

And for *k*-step forecasting (*k*>1),

You can use the KALCVF call when you specify the
alternative transition equation and **G**_{t} = **0**.

The initial state vector and its covariance
matrix of the time invariant Kalman filters
are computed under the stationarity condition

where **F** and **V** are the time invariant transition
matrix and the covariance matrix of transition equation noise,
and vec(**V**) is an *N*_{z}^{2} ×1 column vector that is
constructed by the stacking *N*_{z} 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 **a**_{1} and
its covariance matrix is given by 10^{6}I.
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.