## Documentation Center |

`[ Y,YMSE]
= forecast(Mdl,numPeriods,Y0)` forecasts
the state-space
model

`[ Y,YMSE]
= forecast(Mdl,numPeriods,Y0,Name,Value)` forecasts
the state-space model

For example, for state-space models that include a linear regression component in the observation model, include in-sample predictor data, predictor data for the forecast horizon, and the regression coefficient.

*s*-step-ahead, forecasted
observations are estimates of the observations at period *t* using
all information (for example, the observed responses) up to period *t* – *s*.

The *n _{t}*-by-1 vector
of 1-step-ahead, forecasted observations at period

where
is the *m _{t}*-by-1
estimated vector of state
forecasts at period

At period *t*, the 1-step-ahead, forecasted
observations have variance-covariance matrix

where
is the estimated variance-covariance
matrix of the state
forecasts at period *t*, given all information
up to period *t* – 1.

In general, the *s*-step-ahead, vector of state
forecasts is
. The *s*-step-ahead,
forecasted observation vector is

*s*-step-ahead, state forecasts
are estimates of the states at period *t* using all
information (for example, the observed responses) up to period *t* – *s*.

The *m _{t}*-by-1 vector
of 1-step-ahead, state forecasts at period

where
is
the *m*_{t – 1}-by-1 filtered state vector
at period *t* – 1.

At period *t*, the 1-step-ahead, state forecasts
have the variance-covariance matrix

where
is the estimated variance-covariance
matrix of the filtered
states at period *t* – 1, given all
information up to period *t* – 1.

The corresponding 1-step-ahead forecasted observation is , and its variance-covariance matrix is

In general, the *s*-step-ahead, forecasted
state vector is
. The *s*-step-ahead,
vector of state forecasts is

and the *s*-step-ahead,
forecasted observation vector is

A *state-space model* is
a discrete-time, stochastic model that contains two sets of equations:
one describing how a latent process transitions in time (the *state
equation*), and another describing how an observer measures
the latent process at each period (the *observation equation*).

Symbolically, you can write a linear, multivariate, Gaussian state-space model using the following system of equations

for *t* = 1,...,*T*.

, which is an

*m*-dimensional state vector describing the dynamics of some, possibly unobservable, phenomenon at period_{t}*t*., which is an

*n*-dimensional observation vector describing how the states are measured by observers at period_{t}*t*.*A*is the_{t}*m*-by-_{t}*m*_{t – 1}state-transition matrix describing how the states at time*t*transition to the states at period*t*– 1.*B*is the_{t}*m*-by-_{t}*k*state-disturbance-loading matrix describing how the states at period_{t}*t*combine with the innovations at period*t*.*C*is the_{t}*n*-by-_{t}*m*measurement-sensitivity matrix describing how the observations at period_{t}*t*relate to the states at period*t*.*D*is the_{t}*n*-by-_{t}*h*observation-innovation matrix describing how the observations at period_{t}*t*combine with the observation errors at period*t*.The matrices

*A*,_{t}*B*,_{t}*C*, and_{t}*D*are referred to as_{t}*coefficient matrices*, and might contain unknown parameters., which is a

*k*-dimensional, Gaussian, white-noise, unit-variance vector of state disturbances at period_{t}*t*., which is an

*h*-dimensional, Gaussian, white-noise, unit-variance vector of observation innovations at period_{t}*t*.*ε*and_{t}*u*are uncorrelated._{t}

To write a time-invariant state-space model, drop the *t* subscripts
of all coefficient matrices and dimensions.

In a *time-invariant* state-space
model:

The coefficient matrices are equivalent for all periods.

The number of states, state disturbances, observations, and observation innovations are the same for all periods.

For example, for all *t*, the following system
of equations

represents a time-invariant state-space model.

In a *time-varying* state-space
model:

The coefficient matrices might change from period to period.

The number of states, state disturbances, observations, and observation innovations might change from period to period. For example, this might happen if there is a regime shift or one of the states or observations cannot be measured during the sampling time frame. Also, you can model seasonality using time-varying models.

To illustrate a regime shift, suppose, for *t* =
1,..,10

for *t* = 11

and for *t* = 1,..,*T*

There are three sets of state transition matrices, whereas there are only two sets of the other coefficient matrices.

[1] Durbin J., and S. J. Koopman. *Time Series
Analysis by State Space Methods*. 2nd ed. Oxford: Oxford
University Press, 2012.

Was this topic helpful?