statsmodels/statsmodels — Issue #140: ARMA fit gives strange error depending on model order chosen
Author: adamgreenhall
Created: 2012-01-25 21:50:20+00:00
State: open

This is probably a case where a more helpful exception message could be written. The use case is fitting an ARMA model to data. ARMA(2,1) works fine, as does ARAM(3,1). But ARMA(4,1) raises a hard to decipher exception from deep within the guts of numpy:

Traceback (most recent call last):
File "fit_arma.py", line 19, in
fit=model.fit(order=(4, 1))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scikits/statsmodels/tsa/arima_model.py", line 359, in fit
start_params = self._fit_start_params((k_ar,k_ma,k))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scikits/statsmodels/tsa/arima_model.py", line 86, in _fit_start_params
lagmat(resid,q,'both'))) # stack ar lags and resids
File "/Users/adam/Library/Python/2.7/lib/python/site-packages/numpy/lib/shape_base.py", line 296, in column_stack
return _nx.concatenate(arrays,1)
ValueError: array dimensions must agree except for d_0