-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
predict_in_sample of auto_arima produces fitted-values fluctuating around zero #140
Comments
Thank you, for the fast reply! I look forward to the fix. |
@JahangirVajedsamiei could you provide a reproducible data example so I can start addressing this? |
Here is an exemplary dataframe in excel. It is the respiration rate of a marine mussel over time. |
I'm also affected by the |
See above. #138 should hopefully address this in the next release. |
@tgsmith61591 code below: I have tried both, results are same. Many Thanks |
This was addressed a while ago. What version are you running? |
pmdarima version 1.8.2 |
Could you provide a minimally reproducible example including code and data? |
` df = pd.read_csv('monthly-beer-production-in-austr.csv') arima=auto_arima(input_df, seasonal=True, m=12,max_p=7, max_d=5,max_q=7, max_P=4, max_D=4,max_Q=4) hd_series = pd.Series(fitted, index=input_df.index) plt.plot(hd_series,color='red') |
@suprememingjie your final model results in an When I omit the first result, here's what I see: In [21]: fitted, conf_int = arima_fit.predict_in_sample(return_conf_int=True, alpha=0.05)
...: plt.plot(input_df)
...:
...: hd_series = pd.Series(fitted[1:], index=input_df.index[1:])
...: hdlower_series = pd.Series(conf_int[1:, 0], index=input_df.index[1:])
...: hdupper_series = pd.Series(conf_int[1:, 1], index=input_df.index[1:])
...:
...: plt.plot(hd_series,color='red')
...: plt.fill_between(hdlower_series.index,
...: hdlower_series,
...: hdupper_series,
...: color='k', alpha=.15)
...: plt.show() By the way, as a quick side note, the # no need to fit this again:
arima_fit = arima.fit(input_df.values) |
@tgsmith61591 aha, I made sense the day before yesterday before saw your comment, and also I did the same as you told omitting the first observation which produce the same plot. Anyway, thanks for your kind help. Hope you , your team and your country are well. Best wish |
Description
predict_in_sample of auto_arima produces fitted-values fluctuating around zero, does not follow real data pattern (see the blue line in actual results)! The expected result is made by sm.ARIMA using the same parameters as the auto-arima.
Steps/Code to Reproduce
model_auto = pm.auto_arima(array, start_p=0, start_q=0, max_p=10, max_q=10, max_d=3, error_action="ignore", seasonal=False, D=None, trace=True, stepwise=True, enforce_stationarity=False, enforce_invertibility=False, maxiter=5000)
model_auto.summary()
model_auto.fit(array)
preds = model_auto.predict_in_sample(array)
plt.plot(preds, color='blue')
from statsmodels.tsa.arima_model import ARIMA
model = ARIMA(array, order=(1,1,2)).fit(disp=0)
predict = model.predict(typ='levels')
plt.plot(array, color='lightblue')
plt.plot(predict,color='green')
-->
Expected Results
Actual Results
Versions
The text was updated successfully, but these errors were encountered: