Lesson 8: Testing for IID Hypothesis withthe correlogram
Umberto Triacca
Dipartimento di Ingegneria e Scienze dell’Informazione e MatematicaUniversita dell’Aquila,
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis
Given a time series {x1, x2, ..., xT}, we want establish if it can beconsidered a realization of an i.i.d. process
xt ∼ i .i .d .(0, σ2)
An i.i.d. process is a sequence of independent and identicallydistributed (i.i.d.) random variables with zero mean and varianceσ2
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis
We want to test the null hypothesis
H0 : ρk = 0
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis
The decision rule could be:
Reject H0 if |ρk | > c
where c is a constant.
How do we can choose the constant c?
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
We can choose c such that
P(|ρk | > c |H0) = 0.05
Now, we have
P(|ρk | > c |H0) = 1− P(|ρk | ≤ c|H0) = 0.05
This implies that
P(|ρk | ≤ c |H0) = P(−c√T ≤
√T ρk ≤ c
√T)
= 0.95
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
Ifxt ∼ i .i .d .(0, σ2)
then
√T ρk → N(0, 1)
This means that the standard normal distribution provides a goodapproximation to the true distribution of
√T ρk for large T .
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
It follows that
P(−c√T ≤
√T ρk ≤ c
√T)
= 0.95
if and only ifc√T = 1.96
and hence
c =1.96√T
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
Reject H0 if
|ρk | >1.96√T
that is if
ρk /∈[−1.96√
T,
1.96√T
]
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
If the data {x1, ..., xT} were really generated by an i.i.d. process,then about 95% of the sample autocorrelations ρ1, ρ2, ...ρn shouldfall between the bounds ±1.96√
T.
In other terms, if the considered process is i.i.d., we would expect5% of sample autocorrelations to lie outside the blue dashed lines.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
For example if we calculate the first 40 values of ρk , then oneexpects only two values which fall outside these limits.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
Consider the following time series
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
The correlogram for the data of this example is
We see that 2 of the first 40 values of ρk lie just outside thebounds ±1.96/
√T . As these occur not at relevant time lags, we
conclude that there is no evidence to reject the hypothesis that theobservations are independently distributed.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
If we compute the sample autocorrelations up to lag 40 and findthat more than two or three values fall outside the bounds, or thatone value falls far outside the bounds, we reject the i.i.d.hypothesis.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
Consider the following time series
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
We reject the i.i.d. hypothesis.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
Consider the following time series
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Testing for i.i.d. Hypothesis with the correlogram
In this case, only one value of ρk lies outside the bounds±1.96/
√T . However, this occurs at lag 1, a relevant time lag.
Thus, we reject the i.i.d. hypothesis. As we will see, in this case,an MA(1) model could be appropriate.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
Are the prices of financial assets random walk?
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
The process {xt ; t ∈ Z} is a random walk if
xt = xt−1 + ut
where ut ∼ i .i .d .(0, σ2).The increments, or first differences of x , are independently andidentically distributed (i.i.d.). Thus the increments areunpredictable.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
Usually, to investigate whether the data are RW, the firstdifference data
∆t = xt − xt−1
are used.The difference data should be i.i.d. (0, σ2) if the system is a RW.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
We examine the logarithm of the daily close prices of IBM stockfrom 3 January 2000 to 1 October 2002.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
The graph of the differenced (the returns) series is
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
The corellogram is given by
We accept the random walk hypothesis
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
Here, we consider monthly returns on Bank of New York stockfrom 1990.01 through 1998.12.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
The corellogram is given by
We accept the random walk hypothesis
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Squared Returns
Consider the series of the squared returns
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
The corellogram is given by
We conclude that the the squared returns are not i.i.d.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Test of the random walk hypothesis for financial data
Whereas the sample autocorrelations of the returns are close tozero, the correlogram of the squared returns shows quite a differentpicture: the squared return seems significantly correlated.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Portmanteau testing for i.i.d. processes
In addition to assess the individual significance of sampleautocorrelogram, at a specific lag, the researchers are ofteninterested to the joint significance of a set of sampleautocorrelations.
H0 : ρk = 0 for k = 1, ...,K
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Portmanteau testing for i.i.d. processes
If xt is an i.i.d. sequence with mean zero and finite variance, thenfor T large and K < T , the random variable
QK = TK∑
k=1
ρ2k
is approximately chi-square with K degrees of freedom.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Portmanteau testing for i.i.d. processes
Thus, the joint statistical significance of ρ1, . . . , ρK may be testedusing the Box-Pierce Portmanteau statistic
QK = TK∑
k=1
ρ2k
.
We reject the i.i.d. hypothesis
H0 : ρ1 = ρ2 = . . . = ρK = 0
at level α if QK > χ21−α,K , where χ2
1−α,K is the 1− α quantile ofthe chi-squared distribution with K degrees of freedom.The value K is chosen, somewhat arbitrarily, equal to 20.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram
Portmanteau testing for i.i.d. processes
A refinement of this test, formulated by Ljung and Box (1978), isobtained replacing QK with
QLBK = T (T + 2)
K∑k=1
ρ2k/(T − k)
whose distribution is better approximated by the chi-squareddistribution with K degrees of freedom. Large values of QLB
K leadto a rejection of the null hipothesis.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram