Some issues with ARMAX forecasting #1076

Closed
jseabold opened this Issue Sep 10, 2013 · 1 comment

Projects

None yet

1 participant

@jseabold
Member

Not reported but evident here: http://nbviewer.ipython.org/cb6e9b476a41586958b5
Reported here: http://stackoverflow.com/questions/18721547/armax-model-forecasting-leads-to-valueerror-matrices-are-not-aligned-when-pas

Replicate

y = np.random.random(100)
x = np.random.random(100)
mod = sm.tsa.ARMA(y, (2,1), x).fit()
newx = np.random.random(12)

This breaks because we need to ensure that exog is 2d.

mod.forecast(steps=12, alpha=.05, exog=newx)

This gets further but falls down later

mod.forecast(steps=12, alpha=.05, exog=newx[:,None])

Need to investigate what's going on.

@jseabold
Member

It falls down because you need to pass in past data too. If you want to predict 12 steps ahead with an ARMAX(2,q) model then you need to pass in 14 exogenous observations. I'm going to fix the dims check in exog and add this to the docs.

@jseabold jseabold added a commit to jseabold/statsmodels that referenced this issue Sep 10, 2013
@jseabold jseabold BUG: Ensure 2d for conformability. Closes #1076. 755b6d1
@jseabold jseabold added a commit to jseabold/statsmodels that referenced this issue Oct 23, 2013
@jseabold jseabold BUG: Ensure 2d for conformability. Closes #1076. 7e4f4db
@jseabold jseabold closed this in #1077 Oct 23, 2013
@jseabold jseabold added a commit that referenced this issue Nov 23, 2013
@jseabold jseabold Backport PR #1077: BUG: Allow 1d exog in ARMAX forecasting.
Closes #1076. Another candidate for backporting.
c944f98
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@jseabold jseabold BUG: Ensure 2d for conformability. Closes #1076. 0d646d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment