I wanted to know why did I got 'The computed initial AR coefficients are not stationary' even after specifying the differencing order as 1 while using ARIMA(1,1,1)
. The df['prod rate']
contains values in ascending order from 1 to 20 and I am pretty sure to remove trend I need to apply 1st order differencing here.
I already went through the following answer links:
- Why I got 'The computed initial AR coefficients are not stationary' while using aic_min_order?
- Python Statsmodel ARIMA start [stationarity]
But I couldn't find any solution to my problem.
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')
I got following error while fitting my model:
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.