statsmodels.tsa.statespace.kalman_filter.PredictionResults

class statsmodels.tsa.statespace.kalman_filter.PredictionResults(results, start, end, nstatic, ndynamic, nforecast, oos_results=None)[source]

Results of in-sample and out-of-sample prediction for state space models generally

Parameters:
resultsFilterResults

Output from filtering, corresponding to the prediction desired

startint

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

endint

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

nstaticint

Number of in-sample static predictions (these are always the first elements of the prediction output).

ndynamicint

Number of in-sample dynamic predictions (these always follow the static predictions directly, and are directly followed by the forecasts).

nforecastint

Number of in-sample forecasts (these always follow the dynamic predictions directly).

Attributes:
npredictionsint

Number of observations in the predicted series; this is not necessarily the same as the number of observations in the original model from which prediction was performed.

startint

Zero-indexed observation number at which to start prediction, i.e., the first predict will be at start; this is relative to the original model from which prediction was performed.

endint

Zero-indexed observation number at which to end prediction, i.e., the last predict will be at end; this is relative to the original model from which prediction was performed.

nstaticint

Number of in-sample static predictions.

ndynamicint

Number of in-sample dynamic predictions.

nforecastint

Number of in-sample forecasts.

endogndarray

The observation vector.

designndarray

The design matrix, \(Z\).

obs_interceptndarray

The intercept for the observation equation, \(d\).

obs_covndarray

The covariance matrix for the observation equation \(H\).

transitionndarray

The transition matrix, \(T\).

state_interceptndarray

The intercept for the transition equation, \(c\).

selectionndarray

The selection matrix, \(R\).

state_covndarray

The covariance matrix for the state equation \(Q\).

filtered_statendarray

The filtered state vector at each time period.

filtered_state_covndarray

The filtered state covariance matrix at each time period.

predicted_statendarray

The predicted state vector at each time period.

predicted_state_covndarray

The predicted state covariance matrix at each time period.

forecastsndarray

The one-step-ahead forecasts of observations at each time period.

forecasts_errorndarray

The forecast errors at each time period.

forecasts_error_covndarray

The forecast error covariance matrices at each time period.

Notes

The provided ranges must be conformable, meaning that it must be that end - start == nstatic + ndynamic + nforecast.

This class is essentially a view to the FilterResults object, but returning the appropriate ranges for everything.

Methods

clear()

predict([start, end, dynamic])

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

update_filter(kalman_filter)

Update the filter results

update_representation(model[, only_options])

Update the results to match a given model

Properties

filter_attributes

filtered_forecasts

filtered_forecasts_error_cov

filtered_signal

filtered_signal_cov

kalman_gain

Kalman gain matrices

predicted_signal

predicted_signal_cov

representation_attributes

smoothed_forecasts

smoothed_forecasts_error_cov

smoothed_signal

smoothed_signal_cov

smoother_attributes

standardized_forecasts_error

Standardized forecast errors


Last update: Dec 16, 2024