statsmodels.tsa.statespace.kalman_filter.PredictionResults.predict¶

PredictionResults.predict(start=None, end=None, dynamic=None, **kwargs)

In-sample and out-of-sample prediction for state space models generally

Parameters
startint, optional

Zero-indexed observation number at which to start prediction, i.e., the first prediction will be at start.

endint, optional

Zero-indexed observation number at which to end prediction, i.e., the last prediction will be at end.

dynamicint, optional

Offset relative to start at which to begin dynamic prediction. Prior to this observation, true endogenous values will be used for prediction; starting with this observation and continuing through the end of prediction, predicted endogenous values will be used instead.

**kwargs

If the prediction range is outside of the sample range, any of the state space representation matrices that are time-varying must have updated values provided for the out-of-sample range. For example, of obs_intercept is a time-varying component and the prediction range extends 10 periods beyond the end of the sample, a (k_endog x 10) matrix must be provided with the new intercept values.

Returns
resultskalman_filter.PredictionResults

A PredictionResults object.

Notes

All prediction is performed by applying the deterministic part of the measurement equation using the predicted state variables.

Out-of-sample prediction first applies the Kalman filter to missing data for the number of periods desired to obtain the predicted states.