时序预测模型ARIMA报错,NotImplementedError

from statsmodels.tsa.arima_model import ARMA
from statsmodels.tsa.arima_model import ARIMA

tmp.append(ARIMA(demand_his, (2,1,3)).fit().bic)

报错:

NotImplementedError: 
statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have
been removed in favor of statsmodels.tsa.arima.model.ARIMA (note the .
between arima and model) and statsmodels.tsa.SARIMAX.

statsmodels.tsa.arima.model.ARIMA makes use of the statespace framework and
is both well tested and maintained. It also offers alternative specialized
parameter estimators.

解决:

statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA已经被弃用,所以

将这个from statsmodels.tsa.arima_model import ARIMA注释,改为import statsmodels.api as sm,引用时改为model = sm.tsa.arima.ARIMA()
 

import statsmodels.api as sm
model = sm.tsa.ARIMA(sq_data, order=(p,d,q)).fit()

你可能感兴趣的:(算法)