Skip to content

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

Open
@ara-git

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.

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