Repository navigation
Arima exog predict 2128 rebased - #2470
Conversation
|
I'll merge when TravisCI is green |
|
Before you do, there's another bug in predict that should be fixed here. Take a look at: The problem is that the
Edit: No, that's wrong, sorry; it should be adding a line just after 296 that does:
This seems to fix it for me, but I'm not sure what tests to run to make sure it doesn't have negative consequences elsewhere. |
|
Thanks for looking into this, i will look at it again (in a few hours). I couldn't figure out what values of exog are used if it doesn't have the exact length. It doesn't raise an exception if exog in predict is too long, but I couldn't replicate the result of a too long exog with an exact length exog. |
Here's the source of this bug:
I think that this can be fixed by changing: forecast[-1] = mu[-1] + np.dot(arparams, endog[steps - 1:])to forecast[steps-1] = mu[steps-1] + np.dot(arparams, endog[steps - 1:]) |
|
@ChadFulton Thanks for the notebook, and the comparison ARIMA SARIMAX. We should add something like this to the documentation notebooks. I'm not really an expert on our ARIMA implementation. my suggestion: Either raise a ValueError for length mismatch, or enhance by using pandas index of the exog. But this is a separate bug from the one in this PR (and the original issue and PR) |
|
new issue for this #2472 |
|
something looks fishy with the ARIMA(3, 1, 1) prediction for the exog timing. The level prediction is shifted down compared to ARMA and OLS, with the same exog. edit maybe being a feature in incorrect. We should be using the actual observation as starting point for the forecast, but a integrated process also accumulates innovations forever. ??? |
|
to the previous: timing of exog has to be correct, in the seasonal series, I get the predicted peaks and troughs at exactly the same time as OLS and ARMA. If I shift exog, then not only the height shifts up or down but the extremes shift horizontally (in plot) which is wrong. |
|
reverse engineering: the shift of the prediction in ARIMA is a feature In the seasonal data, the last year had low values, lower than average. ARIMA propagates the lower level to future predictions. |
|
add latest changes to description
looks good, but I haven't tried to figure out |
|
correction: I don't know why I didn't see that |
|
need to lower precision, all python versions of TravisCI fail, but not all at the same assert. |
0609866 to
4d58b3b
Compare
|
2 python versions still failed, lowered precision some more, and amended comit, plus small cleanup |
|
all green, ready to merge @ChadFulton @jseabold any comments? the only thing that's left of the related issues is whether we raise or warn if prediction exog is longer than needed #2472 (I haven't figured out where to check the length.) |
Arima exog predict 2128 rebased
|
merged |
rebased version of #2128, fixes #2127
with additional regression test
(code comments in tests about things I didn't understand.)