statsmodel - TypeError: fit() got an unexpected keyword argument 'disp'

16.5k Views Asked by At

I'm working on some forecasts using statsmodels' arima model. This used to work well with

model_result = model.fit(disp = -1)

but it seems that disp no longer seems to be working -

https://github.com/biolab/orange3-timeseries/blob/a9fb2ab04dffdc8c17cb4020e94a93538099c285/orangecontrib/timeseries/models.py#L305-L306

Has anyone ran into the same problem and knows an alternative for disp? It has not been possible for me to continue reasonably without this.

BR and thank you!

1

There are 1 best solutions below

1
On

I also got the same problem. Two solutions:

1)Use an older version of statsmodels, where disp is still supported, you can do so by installing 0.12.2 version of statsmodels. $pip install statsmodels==0.12.2 disp is an optional argument. If disp = True, or disp >0 convergence information is printed. If disp = False or disp < 0 means no output in this case. You can get rid of the warnings by using this in your code:

import warnings

warnings.filterwarnings("ignore")

2)Use the newer version of statsmodels. disp is no longer supported. So, you can not set a value. use the following code:

import statsmodels.api as smapi

model = smapi.tsa.arima.ARIMA(train_data, order=(1,1,2))

result = model.fit()

Personally speaking the updated version of statsmodels is better.