Computes the pvalue of the statistical portmanteau test (i.e. whether any of a group of autocorrelations of a time series are different from zero).
Syntax
WNTest(X, Order, M, Return_type, Alpha)
 X
 is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)).
 Order
 is the time order in the data series (i.e. the first data point's corresponding 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.
 Return_type
 is a switch to select the return output (1 = PValue (default), 2 = Test Stats, 3 = Critical Value.
Method Description 1 PValue 2 Test Statistics (e.g. Zscore) 3 Critical Value  Alpha
 is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% 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:
$$H_{o}: \rho_{1}=\rho_{2}=...=\rho_{m}=0$$
$$H_{1}: \exists \rho_{k}\neq 0$$
$$1\leq k \leq m$$
Where:
 $H_{o}$ is the null hypothesis.
 $H_{1}$ is the alternate hypothesis.
 $\rho_k$ is the population autocorrelation function for lag k
 $m$ is the maximum number of lags included in the whitenoise test.
 The LjungBox modified $Q^*(m)$ statistic is computed as:
$$Q^* =T(T+2)\sum_{j=1}^{m}\frac{\hat\rho_{j}^2}{Tl}$$
Where:
 $m$ is the maximum number of lags included in the test.
 $\hat\rho_j$ is the sample autocorrelation at lag j.
 $T$ is the number of nonmissing values in the data sample.
 The LjungBox modified $Q^*$ statistic has an asymptotic chisquare distribution with $m$ degrees of freedom and can be used to test the null hypothesis that the time series is not serially correlated.
$$Q^*(m) \sim \chi_{\nu=m}^2()$$
Where:
 $\chi_{\nu}^2()$ is the Chisquare probability distribution function.
 $\nu$ is the degrees of freedom for the Chisquare distribution.
 The LjungBox test 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 ($\alpha$).
Examples
Example 1:


Formula  Description (Result) 

=WNTest(\$B\$2:\$B\$30,1)  pvalue of whitenoise test (0.5995) 
Files Examples
Related Links
References
 D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906
 James Douglas Hamilton; Time Series Analysis; Princeton University Press; 1st edition(Jan 11, 1994), ISBN: 691042896
 Tsay, Ruey S.; Analysis of Financial Time Series; John Wiley & SONS; 2nd edition(Aug 30, 2005), ISBN: 0471690740
 Box, Jenkins and Reisel; Time Series Analysis: Forecasting and Control; John Wiley & SONS.; 4th edition(Jun 30, 2008), ISBN: 470272848
 Walter Enders; Applied Econometric Time Series; Wiley; 4th edition(Nov 03, 2014), ISBN: 1118808568
Comments
Article is closed for comments.