Я хотел знать, почему я получил 'Вычисленные начальные коэффициенты AR не являются стационарными' даже после указания порядка разности равным 1 при использовании ARIMA(1,1,1)
.df['prod rate']
содержит значения в порядке возрастания от 1 до 20, и я уверен, что для удаления тренда мне нужно применить разность 1-го порядка.
Я уже прошел следующие ссылки для ответа:
- Почему я получил 'Вычисленные начальные коэффициенты AR не являются стационарными' при использовании aic_min_order?
- Python Statsmodel ARIMA start [stationarity]
Но я не смог найти решения своей проблемы.
from statsmodels.tsa.arima_model import ARIMA
plt.figure(figsize = (10,6))
model = ARIMA(df['prod rate'], order = (1,1,1))
results_AR = model.fit()
plt.plot(df['prod rate'], label = "Original")
plt.plot(results_AR.fittedvalues, color = 'red', label = 'Predictions')
plt.legend(loc = 'best')
При установке моей модели я получил следующую ошибку:
ValueError Traceback (most recent call last)
<ipython-input-59-2b92bbf4a4de> in <module>()
2 plt.figure(figsize = (10,6))
3 model = ARIMA(df['prod rate'], order = (1,1,1))
----> 4 results_AR = model.fit()
5 plt.plot(df['prod rate'], label = "Original")
6 plt.plot(results_AR.fittedvalues, color = 'red', label = 'Predictions')
3 frames
/usr/local/lib/python3.6/dist-packages/statsmodels/tsa/arima_model.py in _fit_start_params_hr(self, order, start_ar_lags)
539 if p and not np.all(np.abs(np.roots(np.r_[1, -start_params[k:k + p]]
540 )) < 1):
--> 541 raise ValueError("The computed initial AR coefficients are not "
542 "stationary\nYou should induce stationarity, "
543 "choose a different model order, or you can\n"
ValueError: The computed initial AR coefficients are not stationary
You should induce stationarity, choose a different model order, or you can
pass your own start_params.