Plot diagnostics
It is important to know when you need to go back to the drawing board in model design. In this exercise you will use 4 common plots to decide whether a model is a good fit to some data.
Here is a reminder of what you would like to see in each of the plots for a model that fits well:
Test | Good fit |
---|---|
Standardized residual | There are no obvious patterns in the residuals |
Histogram plus kde estimate | The KDE curve should be very similar to the normal distribution |
Normal Q-Q | Most of the data points should lie on the straight line |
Correlogram | 95% of correlations for lag greater than zero should not be significant |
An unknown time series df
and the ARIMA
model class are available for you in your environment.-
This exercise is part of the course
ARIMA Models in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create and fit model
model = ARIMA(df, order=(____))
results = model.fit()
# Create the 4 diagnostics plots
____
plt.show()