Lesson 8: Testing for IID Hypothesis with the correlogram
Umberto Triacca
Dipartimento di Ingegneria e Scienze dell’Informazione e Matematica Universit`adell’Aquila, [email protected]
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 be considered a realization of an i.i.d. process
2 xt ∼ i.i.d.(0, σ )
An i.i.d. process is a sequence of independent and identically distributed (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
If 2 xt ∼ i.i.d.(0, σ ) then √ T ρˆk → N(0, 1)
This means that the standard normal distribution√ provides a good approximation 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 if √ c T = 1.96 and hence 1.96 c = √ T
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram Testing for i.i.d. Hypothesis with the correlogram
Reject H0 if 1.96 |ρˆk | > √ T
that is if 1.96 1.96 ρˆk ∈/ − √ , √ T 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 should fall between the bounds ± 1√.96 . T
In other terms, if the considered process is i.i.d., we would expect 5% 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 one expects 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 the bounds ±1.96/ T . As these occur not at relevant time lags, we conclude that there is no evidence to reject the hypothesis that the observations 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 find that more than two or three values fall outside the bounds, or that one 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
2 where ut ∼ i.i.d.(0, σ ). The increments, or first differences of x, are independently and identically distributed (i.i.d.). Thus the increments are unpredictable.
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 first difference 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 stock from 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 stock from 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 to zero, the correlogram of the squared returns shows quite a different picture: 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 sample autocorrelogram, at a specific lag, the researchers are often interested to the joint significance of a set of sample autocorrelations.
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, then for T large and K < T , the random variable
K X 2 QK = T ρˆk k=1 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 tested using the Box-Pierce Portmanteau statistic
K X 2 QK = T ρˆk k=1 . We reject the i.i.d. hypothesis
H0 : ρ1 = ρ2 = ... = ρK = 0
2 2 at level α if QK > χ1−α,K , where χ1−α,K is the 1 − α quantile of the 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), is obtained replacing QK with
K LB X 2 QK = T (T + 2) ρˆk /(T − k) k=1 whose distribution is better approximated by the chi-squared LB distribution with K degrees of freedom. Large values of QK lead to a rejection of the null hipothesis.
Umberto Triacca Lesson 8: Testing for IID Hypothesis with the correlogram