Residual analysis - I
As you saw in the video, an sarima()
run includes a residual analysis graphic. Specifically, the output shows (1) the standardized residuals, (2) the sample ACF of the residuals, (3) a normal Q-Q plot, and (4) the p-values corresponding to the Box-Ljung-Pierce Q-statistic.
In each run, check the four residual plots as follows:
- The standardized residuals should behave as a white noise sequence with mean zero and variance one. Examine the residual plot for departures from this behavior.
- The sample ACF of the residuals should look like that of white noise. Examine the ACF for departures from this behavior.
- Normality is an essential assumption when fitting ARMA models. Examine the Q-Q plot for departures from normality and to identify outliers.
- Use the Q-statistic plot to help test for departures from whiteness of the residuals.
As in the previous exercise, dl_varve <- diff(log(varve))
, which is plotted below a plot of varve
. The astsa package is preloaded.
This exercise is part of the course
ARIMA Models in R
Exercise instructions
- Use
sarima()
to fit an MA(1) todl_varve
and do a complete residual analysis as prescribed above. Make a note of what you see for the next exercise. - Use another call to
sarima()
to fit an ARMA(1,1) todl_varve
and do a complete residual analysis as prescribed above. Again, make a note of what you see for the next exercise.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Fit an MA(1) to dl_varve. Examine the residuals
# Fit an ARMA(1,1) to dl_varve. Examine the residuals