Phone: +1 (888) 427-9486
+1 (312) 324-0367
Fax: +1 (312) 238-9092
Contact Us
WNTest (Pro.)
| Attachment | Size | |
|---|---|---|
| WNTest.xlsx |
Computes the p-value of the statistical portmanteau test (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 white-noise:



Where:
-
is the null hypothesisi.
-
is the alternate hypothesis.
-
is the population autocorrelation function for lag k
-
is the maximum number of lags included in the white-noise test.
-
-
The Ljung-Box 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 non-missing values in the data sample.
-
-
The Ljung-Box modified
statistic has an asymptotic chi-square 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 Chi-square probability distribution function.
-
is the degrees of freedom for the Chi-square distribution.
-
- The Ljung-Box test is a suitable test for all sample sizes including small ones.
-
This is one-side (i.e. one-tail) test, so the computed p-value should be compared with the whole significance level (
).
Examples
Example 1:
Let's consider the following sample time series data (see spreadsheet attachment):

Now, let's compute the P-Value for different number of lags (i.e.
)


Please note the P-Value of the White noise test levels up around
, a declines as the test looses its power for larger lags in small sample.
References
- Hamilton, J .D.; Time Series Analysis
, Princeton University Press (1994), ISBN 0-691-04289-6 - Tsay, Ruey S.; Analysis of Financial Time Series
John Wiley & SONS. (2005), ISBN 0-471-690740
