Skip to content

In CH9, "res.forecast" should be used instead of "res.get_predicted_mean" #12

Description

@ara-git

Ch9 does not seem to be doing a good job of predicting one period ahead.
Although the code is trying to forecast GDP one period ahead of the train data, it seems to be predicting the last value of train data.

To fulfill the objective, "res.forecast()" should be used instead of "res.get_predicted_mean()".

For example, in the definition of "recursive_forecast", instead of

predictions = res.get_prediction(exog=exog)
oos_pred = predictions.predicted_mean.iloc[-window:]
pred_SARIMAX.extend(oos_pred)

,

predictions = res.forecast(step = 1, exog=exog.iloc[i])
pred_SARIMAX.extend(predictions)

would be work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions