Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 16

Testing Residuals for

White Noise in Time Series


The Portmanteau Tests

Deborah Diamante
Fall 2004
 “On a Measure of Lack of Fit in Time Series
Models”; GM Ljung & GEP Box; Biometrika 1970

 “Distribution of Residual Autocorrelations in


ARIMA Time Series Models”; GEP Box & DA
Pierce; JAMA 1978
Overview

 Example
 Introduction to ARIMA in time series
 Distribution of B-P Test Statistic
 A better Test Statistic
 Return to Example
What is the question?

 Does the model we fit to our data yield


uncorrelated errors (residuals)?

 Hypotheses:
H 0 : 1   2  ...   m  0
H1 : at least one non  zero
Example: Dow Jones Utilities Index
(Aug. 28 – Dec. 18, 1972)
S e r ie s

124.

122.

120.

118.

116.

114.

112.

110.

108.

0 10 20 30 40 50 60 70

 What ARIMA model yields uncorrelated


errors?
Introduction to ARIMA
Models in Time Series
 Usual definition, denoted ARIMA(p,d,q)

 ( B)(1  B) d xt   ( B) zt zt ~ WN (0,  2 )

 Where B is the “backshift” operator defined as


B( zt )  zt 1
B l ( zt )  zt l
 And

 ( B )  1  1 B  ...   p B p
 ( B )  1  1 B  ...   q B q
 To simplify, call Yt the differenced time series so that
yt  (1  B ) d xt

 The Yt can be written as a linear function of previous observations,


previous white noise and current white noise:

yt  i 1i yt i   j 1 j zt  j  zt
p q

 In practice we must choose an appropriate model (p,d, and q) and


estimate the model parameters. After fitting a model to some
sample series, we wish to consider the stochastic properties of the
residuals
Zˆ  ( zˆ1 , zˆ2 ,..., zˆn )'
 The ACF (Autocorrelation function) at lag k

k 
 zz
t t k
~ MVN
z 2
t
Anderson (1942)

The autocorrelations are uncorrelated with variances

nk 1
Var (  k )  
n(n  2) n

So that the statistics

n(n  2)k 1 (n  k ) 1  k2 ~  2 (m)


m

nk 1  k2 ~  2 (m)
m

What if we replace the ACF with the sample ACF?


Distribution of B-P Test Statistic
BP  nk 1 ̂ k2
m

 For the AR(p) process


 ( B ) yt  z t
 Can be rewritten as an MA(infinity) process
yt   1 ( B) zt   ( B) zt   j 0 j zt  j

 ˆ 1 ( B) zt  ˆ ( B) zt   j 0ˆ j zˆt  j

 Along with orthogonality constraints we have


0  t  p 1 zˆt yt  j
n
1 j  p

 t  p 1 k 0 zˆtˆ k zˆt  k  j
n 

 k 0ˆ k ˆ k  j

 k 0 k ˆ k  j with O p (1 / n)
m
 Using the first order Taylor expansion about ˆ   it can be shown
that for k = 1 … m
ˆ k   k   j 1 ( j  ˆj ) k  j
p

 In matrix notation this is


ˆ    X (  ˆ) where
 1 0 ... 0 
 1 . . 
 1 
X   2 1 . 0 
 
 ... . . 1 
 m 1  m  2 ...  m  p 
  mx p

 Thus, for Q=X(X’X)-1X’ we have


ˆ  ( I  Q) 
 ~ N m (0, (1 / n) I m )
ˆ ~ N m (0, (1 / n)[ I  Q])
 It follows that the test statistic has Chi-squared distribution

BP  nk 1 ˆ k2  nˆ ' ˆ ~  2 ( r )


m

where r  r[ I  Q] m  p
iff [ I  Q] is idempotent

Show [ I  Q]  [ I  Q][ I  Q]

[ I  Q][ I  Q]
 I  Q  Q  QQ
 I  2Q  X ( X ' X ) 1 X ' X ( X ' X ) 1 X '
 I  2Q  X ( X ' X ) 1 X '
 I  2Q  Q
 I Q
 Therefore, if we have Yt AR(p) then
BP  nk 1 ˆ k2 ~  2 (m  p )
m

 Similarly Box and Pierce show that if


we have any ARIMA(p,d,q) then
BP  nk 1 ˆ k2 ~  2 (m  p  q )
m

 Requires n large relative to m


A Better Test Statistic

 Ljung and Box make simple


modification yielding substantially
improved approximation!

LB  n(n  2)k 1 (n  k ) 1 ˆ k2 ~  2 (m  p  q)
m
Return to Example
n = 78, choose m = 24, alpha = 0.05

proc
 Fitarima data=dowj;
an ARIMA(1,1,0)
identify var=DOWJ nlag=24;
LB = 38.88, p = 0.0205
identify var=DOWJ(1) nlag=24;
Reject the null hypothesis
/* Syntax to fit AR(1) model to (1-B)DOWJ using ML*/
estimate
 Fit anp=1
ARIMA(0,1,1)
method=ml;
run; LB = 40.22, p = 0.0145
Reject the null hypothesis
/* Syntax to fit MA(1) model to (1-B)DOWJ using ML*/
estimate q=1 method=ml;
 Fit an ARIMA(1,1,1)
run;
LB = 33.50, p = 0.0551
/* Syntax Do notARMA(1,1)
to fit reject the model
null hypothesis
to (1-B)DOWJ using ML*/
estimate p=1 q=1 method=ml;
run;
Other Tests Exist

 McLeod-Li portmanteau test (1983)

 Turning Point Test

 Difference-Sign Test
Thank You!

 Dr. Ravishanker
 Dr. Dey

Questions?

You might also like