Skip to content

Instantly share code, notes, and snippets.

@kangeugine
Created August 26, 2017 15:38
Show Gist options
  • Save kangeugine/9aaa186e6674d731d03e6594a3a04cdf to your computer and use it in GitHub Desktop.
Save kangeugine/9aaa186e6674d731d03e6594a3a04cdf to your computer and use it in GitHub Desktop.
ARIMA fit model and residuals
from statsmodels.tsa.arima_model import ARIMA
# fit model
model = ARIMA(series, order=(5,1,0))
model_fit = model.fit(disp=0)
# print(model_fit.summary())
# plot residual erros
residuals = pd.DataFrame(model_fit.resid)
residuals.plot()
residuals.plot(kind='kde')
plt.show()
print(residuals.describe())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment