Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

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 z_{t+1| t} and the filtered estimate z_{t| t}, 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, (\eta^'_t, \epsilon^'_t)^'.

z0
is an optional 1 ×Nz initial state vector z^'_{1|}.

vz0
is an optional Nz ×Nz covariance matrix of an initial state vector P_{1|}.
The KALCVF call returns the following values:
pred
is a (T+ lead) ×Nz matrix containing one-step predicted state vectors (z_{1|}, ... , z_{T+1| T}, 
z_{T+2| T},  ... , z_{T+{lead}| T})^'.

vpred
is a (T+ lead)Nz ×Nz matrix containing mean square errors of predicted state vectors (P_{1|},  ... , P_{T+1| T}, P_{T+2| T}, 
 ... , P_{T+{lead}| T})^'.

filt
is a T ×Nz matrix containing filtered state vectors (z_{1| 1},  ... , z_{T| T})^'.

vfilt
is a TNz ×Nz matrix containing mean square errors of filtered state vectors (P_{1| 1},  ... , P_{T| T})^'.
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 \eta_t and \epsilon_t, respectively, and Gt is a covariance of \eta_t and \epsilon_t.A- stands for the generalized inverse of A. The filtered value and its covariance matrix are denoted z_{t| t} and P_{t| t}, respectively. For k>0, z_{t+k| t} and P_{t+k| t} 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
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}
When you use the alternative transition equation
z_t = a_t + F_t{z}_{t-1} + \eta_t
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
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}
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)
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 z_{1|} is set to a1 and its covariance matrix P_{1|} 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.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.