Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

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

Writer Andrew Mclaughlin

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 -

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

1 Answer

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.2disp 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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.