Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ara-git opened this issue Nov 21, 2023 · 0 comments
Open

Comments

@ara-git
Copy link

ara-git commented Nov 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant