Learn R Programming

KFAS (version 0.6.1)

forecast: Forecast state space model

Description

Performs forecasting using output from function 'kf' (Kalman filter).

Usage

forecast(out,  fc=1,  Zt.fc=NULL,  Tt.fc=NULL,  Rt.fc=NULL,
Ht.fc=NULL,  Qt.fc=NULL)

Arguments

out
Output from function 'kf'.
fc
Integer which states how many observations is forecasted.
Zt.fc
In case where matrix Z is not time-invariant, p*m*fc array of matrix Zt, t=n+1,...,n+fc.
Tt.fc
In case where matrix T is not time-invariant, m*m*fc array of matrix Tt, t=n+1,...,n+fc.
Rt.fc
In case where matrix R is not time-invariant, m*r*fc array of matrix Rt, t=n+1,...,n+fc.
Ht.fc
In case where matrix H is not time-invariant, p*p*fc array of matrix Ht, t=n+1,...,n+fc.
Qt.fc
In case where matrix Q is not time-invariant, r*r*fc array of matrix Qt, t=n+1,...,n+fc.

Value

  • A list with the following elements:
  • yt.fcp*fc array of forecasts of observations.
  • Ft.fcp*p*fc array of mean square error matrix.
  • at.fcm*(fc+1) array of E(alpha_t | y_1, y_2, ... , y_n).
  • Pt.fcm*m*(fc+1) array of Var(alpha_t | y_1, y_2, ... , y_n).

Details

The state space model is given by

y_t = Z_t * alpha_t + eps_t (observation equation)

alpha_t+1 = T_t * alpha_t + R_t * eta_t(transition equation)

where eps_t ~ N(0,H_t) and eta_t ~ N(0,Q_t).

Dimensions of variables are: 'yt' p*n 'Zt' p*m or p*m*n 'Tt' m*m or m*m*n 'Rt' m*r or m*r*n 'Ht' p*p or p*p*n 'Qt' r*r or r*r*n