Created
August 26, 2017 15:38
-
-
Save kangeugine/9aaa186e6674d731d03e6594a3a04cdf to your computer and use it in GitHub Desktop.
ARIMA fit model and residuals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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