Phone: +1 (888) 4279486
+1 (312) 2573777
Contact Us
WNTest
Attachment  Size  

WNTest.xlsx 
Computes the pvalue of the statistical portmanteau ljung box test in Excel (i.e. whether any of a group of auto correlations of a time series are different from zero).
Syntax
X
is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)).
Order
is the time order of the data series (i.e. whether the first data point corresponds to the earliest or latest date (earliest date=1 (default), latest date=0)).
Order  Description 

1  ascending (the first data point corresponds to the earliest date) (default) 
0  descending (the first data point corresponds to the latest date) 
M
is the maximum number of lags to include in the test. If omitted, the default value of log(T) is assumed.
Remarks
 The time series is homogeneous or equally spaced.
 The time series may include missing values (e.g. #N/A) at either end.

The test hypothesis for whitenoise:
Where:
 is the null hypothesis^{i}.
 is the alternate hypothesis.
 is the population autocorrelation function for lag k
 is the maximum number of lags included in the whitenoise test.

The Ljung Box test in Excel modified statistic is computed as:
Where:
 is the maximum number of lags included in the test.
 is the sample autocorrelation at lag j.
 is the number of nonmissing values in the data sample.

The Ljung Box test in Excel modified statistic has an asymptotic chisquare distribution with degrees of freedom and can be used to test the null hypothesis that the time series is not serially correlated.
Where:
 is the Chisquare probability distribution function.
 is the degrees of freedom for the Chisquare distribution.
 The Ljung Box test in Excel is a suitable test for all sample sizes including small ones.
 This is oneside (i.e. onetail) test, so the computed pvalue should be compared with the whole significance level ().
 In practice, the selection of may affect the performance of the statistic. Several values of m are often used. Simulation studies suggest that the choice of provides better power performance.
Examples
Example 1:
Let's consider the following sample time series data (see spreadsheet attachment):
Now, let's compute the PValue for different number of lags (i.e. )
Please note the PValue of the White noise Ljung Box test in Excel levels up around , a declines as the test looses its power for larger lags in small sample.
Files Examples
References
 Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0691042896
 Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0471690740
Attachment  Size 

WNTest.xlsx  14.75 KB 