Time Series-ch08

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Ch 8.

MODEL DIAGNOSTICS

Time Series Analysis

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Model diagnostics is concerned with testing the goodness of fit of
a model and, if the fit is poor, suggesting appropriate
modifications. We shall present two complementary approaches:
analysis of residuals from the fitted model and analysis of
overparameterized models.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


8.1 Residual Analysis
For an AR(p) model: Yt = pk=1 φk Yt−k + θ0 + et , after
P

obtaining the estimated coefficients φ̂k and θ̂0 , the residuals are
defined as
X p
êt = Yt − φ̂k Yt−k − θ̂0 .
k=1
For an invertible ARMA(p,q) model containing MA terms, we
use the inverted infinite AR form of the model to define residuals:
Yt = π1 Yt−1 + π2 Yt−2 + π3 Yt−3 + · · · + et
⇒ êt = Ŷt − π̂1 Yt−1 − π̂2 Yt−2 − π̂3 Yt−3 − · · ·
or residual = actual − predicted.
The π̂’s are calculated implicitly as functions of the estimated φ’s
and θ’s.
If the model is correctly specified and the parameter estimates
are reasonably close to the true values, then the residuals should
have nearly the properties of white noise.
Time Series Analysis Ch 8. MODEL DIAGNOSTICS
8.1.1. Plots of the Residuals

The parameters of the AR(1) model were estimated using


maximum likelihood. The plot shows a rectangular scatter around
a zero horizontal level with no trend, which supports the model.
Time Series Analysis Ch 8. MODEL DIAGNOSTICS
The model of hare0.5 built in Exhibit 7.8 is an AR(3) model with
φ2 term dropped:
p p p
Yt = 3.483 + 0.919 Yt−1 − 0.5313 Yt−3 + et
From the standardized residual plot, the variation looks not quite
consistent. The model is not so ideal. (The seemingly large negative
standardized residuals are not outliers according to the Bonferroni outlier
criterion with critical values ±3.15. )
Time Series Analysis Ch 8. MODEL DIAGNOSTICS
The standardized residual plot looks fine, except for a few spikes. At least
two or three residuals have magnitude greater than 3, which is rare for a
standard white noise process. We should investigate the other factors
influencing the change of oil prices. ( The Bonferroni critical values with
n = 241 and α = 0.05 are ±3.71, so the outliers do appear to be real.)
Time Series Analysis Ch 8. MODEL DIAGNOSTICS
8.1.2 Normality of the Residuals
We use quantile-quantile plots and Shapiro-Wilk normality test on
standardized residuals to assess normality.

The QQ plot and the Shapiro-Wilk normality test (W = 0.9754,


p-value= 0.6057) would not lead us to reject normality of the error
terms in this model.
Time Series Analysis Ch 8. MODEL DIAGNOSTICS
The extreme values look suspect. However, the sample is small
(n = 31) and the Bonferroni criteria do not indicate outliers.
Shapiro-Wilk Test does not reject null hypothesis of normality.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


The outliers are quite prominent. Shapiro-Wilk Test would reject
the null hypothesis.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


8.1.3 Autocorrelation of the Residuals

For true white noise with large n, the sample autocorrelations rk


are approximately normally distributed with zero means. We have
seen that

For the sample autocorrelations rˆk of the residuals in a correctly


specified model, however, Var (r̂k ) has slightly different behaviors:
for small lags k and j, Var (r̂k ) can be substantially less than
1/n and the estimates Var (r̂k ) and Var (r̂j ) can be highly
correlated.
For larger lags, the approximate variance 1/n does apply;
furthermore, Var (r̂k ) and Var (r̂j ) are approximately
uncorrelated.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


φ2 1
For an AR(1) Model, for large n, Var (r̂1 ) ≈ and Var (r̂k ) ≈
n n
for k > 1. Exhibit 8.7 shows the approximations for Residual
Autocorrelations in AR(1) Models.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Time Series Analysis Ch 8. MODEL DIAGNOSTICS
There is no evidence of autocorrelation in the residuals of this
model.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


For an AR(2) model, we have

φ22 φ22 + φ21 (1 + φ2 )2


Var (r̂1 ) ≈ , Var (r̂2 ) ≈
n n
If the AR(2) parameters are not too close to the stationarity
boundary, then
1
Var (r̂k ) ≈ for k ≥ 3.
n

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


The graph does not show statistically significant evidence of
nonzero autocorrelation in the residuals.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


With monthly data, we may pay special attention to the residuals
at lags 12, 24, and so forth. With quarterly series, lags 4, 8, and so
forth would merit special attention. Chapter 10 contains examples
of these ideas.

The residuals for MA models have similar results.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


8.1.4 The Ljung-Box Test

To study the independence of the residuals, we may takes into


account the magnitudes of all residual correlations {ˆ
rk } as a group.
The Ljung-Box test statistic is

rˆ2
 2
rˆ2

rˆ1
Q∗ = n(n + 2) + 2 + ··· + K
n−1 n−2 n−K

where K is selected large enough such that the Ψ-weights are


negligible for j > K . We would reject the ARMA(p,q) model if the
observed value of Q∗ exceeded an appropriate critical value in a
chi-square distribution with K − p − q degrees of freedom.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


The Ljung-Box test statistic can be calculated by the command:
LB.test(m1.color, lag=6)

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Time Series Analysis Ch 8. MODEL DIAGNOSTICS
Overfitting and Parameter Redundancy
Another basic diagnostic tool is that of overfitting. After fitting a
likely adequate model, we fit a slightly more general model and
compare it with the original model. The original model would be
confirmed if:
1 the estimate of the additional parameter is not significantly
different from zero, and
2 the estimates for the parameters in common do not change
significantly from their original estimates.
We may compare the other statistics, such as log-likelihood and
AIC, as well.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Ex. We have specified, fitted, and examined the residuals of an AR(1)
model for the industrial color property time series. Let us compare it with
slightly more general models: AR(2) and ARMA(1,1) models.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


(cont.) Here are some observations:
1 In Exhibit 8.14, the estimate of φ2 is not statistically different
from zero;
2 two estimates of φ1 and µ are quite close;
3 while the AR(2) model has a slightly larger log-likelihood
value, the AR(1) fit has a smaller AIC value.
Therefore, the simpler AR(1) model is better.

Next we compare the AR(1) model with the ARMA(1,1) model.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Ex.

Observations:
1 the new parameter θ is not significantly different from zero;
2 the estimate of φ1 and µ are not significantly different from the
estimate in Exhibit 8.13;
3 the AIC is greater than that of the AR(1) fit.
Again the AR(1) model looks better.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


When generalizing ARMA models, we must be aware of the
problem of parameter redundancy.

Define the backshift operation B on any process {Yt } by


B(Yt ) = Yt−1 . For example, an ARMA(1,1) model:
Yt = φYt−1 + et − θet−1 , may be expressed as
Yt − φYt−1 = et − θet−1 , which is (1 − φB)Yt = (1 − θB)et .

If we have a correct ARMA model: φ(B)Yt = θ(B)et , then


(1 − cB)φ(B)Yt = (1 − cB)θ(B)et is also a correct model. This
creates parameter redundancy. To get unique ARMA model, we
must cancel any common factors in the AR and MA characteristic
polynomials.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


To avoid parameter redundancy:
1 Try simple models first.
2 When overfitting, do not increase the the AR and MA orders
simultaneously.
3 Extend the model in directions suggested by the analysis (e.g.
ACF, PACF) of the residuals.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS


Ex.

The estimates of φ1 , φ2 , and θ in this ARMA(2,1) fit are very


different from those in AR(1) fit, and they are not significantly
different from zero.

Time Series Analysis Ch 8. MODEL DIAGNOSTICS

You might also like