In time series sample data there is always noise. But there exist different types of noise. In this post we will run through regular white noise and iid noise and how to identify them in your residuals with ACF/PACF plots and the Ljung-Box test after for example applying an ARMA or GARCH model. First we need to define weak stationarity before we define white noise.
What is Weak Stationarity?
A time series X is weakly stationary if
E[Xt]=μ=const for all t∈Z
Var[Xt]=σ2=const<∞ for all t∈Z
Cov[Xr,Xs]=Cov[Xr+h,Xs+h] for all s,r,h∈Z
Defintion of White Noise
A time series X is said to be white noise if
X is weakly stationary
γ(h)=Cov[Xt,Xt+h]=0 where h=0
Definition of IID Noise
What is iid noise? A time series X is said to be iid noise if it meets the conditions for regular white noise above but also Xr and Xs (r=s) is independent of each other and identically distributed for all r,s∈Z, that is why it is called iid noise where iid stands for independent and identically distributed.
Before going through the tricks to identifying the two different kind of noises we need to go through the definitions of the autocorrelation function (ACF) and the partial autocorrelation function (PACF).
The Autocorrelation Function (ACF)
The autocorrelation function for the time series X is defined as:
ρX(h)=γ(0)γ(h)=Var[Xt]Cov[Xt,Xt+h].
The Partial Autocorrelation Function (ACF)
The autocorrelation function α(h) for the time series X is defined by α(0)=1 and α(h)=ϕhh for h≥1 where ϕhh is the last component of
ϕh=([γ(i−j)]i,j=1h)−1[γ(1),...,γ(h)]′.
ACF Plot Interpretation - How to Identify White Noise
The first simple thing you could do to see if your data is just white noise is if it looks like it has no structure. The second thing is looking at the sample ACF and PACF graphs for the data. Lets look at the definition of white noise and the ACF. We know that γ(h)=0 for h≥1 for white noise which means ρX(h)=0 for h≥1. So all lags greater than zero should be within the red striped confidence band (±1.96/n, where n is the sample size) of the ACF in the plot below. So the following sample ACF plot indicates white noise:
The same can be said for the PACF. If X is white noise then the vector [γ(1),...,γ(h)]′ will just be filled with zeros and thus α(h)=0 for h≥1.
How to Identify IID Noise
To identify iid noise we will have to look at the sample ACF and PACF of the data squared, X2. Lets start with the ACF. We have:
Lastly we use the general property that E[E[Y]]=E[Y] so we get:
(E[Xt2]−E[Xt2])(E[Xt+h2]−E[Xt+h2])=0.
So the sample ACF for X2 should be in the confidence band for all lags greater than zero. For the PACF we can see that the vector [γX2(1),...,γX2(h)]′ would be zero for all h. Therefore the PACF should also be within the confidence band for lags greater than zero if X were to be iid noise which we can see in the following plot:
So to conclude, for iid noise X and X2's sample ACF and PACF should all have to be within the confidence band for lags greater than zero.
Ljung-Box Test for IID Noise
Lastly one can do a Ljung-Box test to determine whether the data is independently distributed. The test is defined by the following hypothesis:
H0:X∼IID(μ,σ2)H1:X∼IID(μ,σ2)
The Ljung-Box test has a test statistic which is:
λ=n(n+2)i=1∑hn−iρ^(i)2,
where ρ^(i) is the sample ACF at lag i, n is the sample size and h is the number of lags being tested. The null-hypothesis, H0, is rejected at the α-level, α∈(0,1), if λ>χ1−α,h2, where χ1−α,h2 denotes the 1−α-quantile of the χ2-distribution with h degrees of freedom.