Ljung–box Test
   HOME

TheInfoList



OR:

The Ljung–Box test (named for Greta M. Ljung and
George E. P. Box George Edward Pelham Box (18 October 1919 – 28 March 2013) was a British statistician, who worked in the areas of quality control, time-series analysis, design of experiments, and Bayesian inference. He has been called "one of the gre ...
) is a type of
statistical test A statistical hypothesis test is a method of statistical inference used to decide whether the data provide sufficient evidence to reject a particular hypothesis. A statistical hypothesis test typically involves a calculation of a test statistic. ...
of whether any of a group of
autocorrelation Autocorrelation, sometimes known as serial correlation in the discrete time case, measures the correlation of a signal with a delayed copy of itself. Essentially, it quantifies the similarity between observations of a random variable at differe ...
s of a
time series In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
are different from zero. Instead of testing
randomness In common usage, randomness is the apparent or actual lack of definite pattern or predictability in information. A random sequence of events, symbols or steps often has no order and does not follow an intelligible pattern or combination. ...
at each distinct lag, it tests the "overall" randomness based on a number of lags, and is therefore a
portmanteau test A portmanteau test is a type of statistical hypothesis test in which the null hypothesis is well specified, but the alternative hypothesis is more loosely specified. Tests constructed in this context can have the property of being at least modera ...
. This test is sometimes known as the Ljung–Box Q test, and it is closely connected to the Box–Pierce test (which is named after
George E. P. Box George Edward Pelham Box (18 October 1919 – 28 March 2013) was a British statistician, who worked in the areas of quality control, time-series analysis, design of experiments, and Bayesian inference. He has been called "one of the gre ...
and David A. Pierce). In fact, the Ljung–Box test statistic was described explicitly in the paper that led to the use of the Box–Pierce statistic, and from which that statistic takes its name. The Box–Pierce test statistic is a simplified version of the Ljung–Box statistic for which subsequent simulation studies have shown poor performance. The Ljung–Box test is widely applied in
econometrics Econometrics is an application of statistical methods to economic data in order to give empirical content to economic relationships. M. Hashem Pesaran (1987). "Econometrics", '' The New Palgrave: A Dictionary of Economics'', v. 2, p. 8 p. 8 ...
and other applications of
time series analysis In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
. A similar assessment can be also carried out with the Breusch–Godfrey test and the Durbin–Watson test.


Formal definition

The Ljung–Box test may be defined as: : H_0: The data is not correlated (i.e. the correlations in the population from which the sample is taken are 0, so that any observed correlations in the data result from randomness of the sampling process). : H_a: The data exhibit serial correlation. The test statistic is: : Q = n(n+2)\sum_^h\frac where ''n'' is the sample size, \hat_k is the sample autocorrelation at lag ''k'', and ''h'' is the number of lags being tested. Under H_0 the statistic Q asymptotically follows a \chi^2_. For
significance level In statistical hypothesis testing, a result has statistical significance when a result at least as "extreme" would be very infrequent if the null hypothesis were true. More precisely, a study's defined significance level, denoted by \alpha, is the ...
α, the
critical region A statistical hypothesis test is a method of statistical inference used to decide whether the data provide sufficient evidence to reject a particular hypothesis. A statistical hypothesis test typically involves a calculation of a test statistic. T ...
for rejection of the hypothesis of randomness is: : Q > \chi_^2 where \chi_^2 is the (1 − ''α'')-
quantile In statistics and probability, quantiles are cut points dividing the range of a probability distribution into continuous intervals with equal probabilities or dividing the observations in a sample in the same way. There is one fewer quantile t ...
of the
chi-squared distribution In probability theory and statistics, the \chi^2-distribution with k Degrees of freedom (statistics), degrees of freedom is the distribution of a sum of the squares of k Independence (probability theory), independent standard normal random vari ...
with ''h'' degrees of freedom. The Ljung–Box test is commonly used in
autoregressive integrated moving average In time series analysis used in statistics and econometrics, autoregressive integrated moving average (ARIMA) and seasonal ARIMA (SARIMA) models are generalizations of the autoregressive moving average (ARMA) model to non-stationary series and pe ...
(ARIMA) modeling. Note that it is applied to the residuals of a fitted ARIMA model, not the original series, and in such applications the hypothesis actually being tested is that the residuals from the ARIMA model have no autocorrelation. When testing the residuals of an estimated ARIMA model, the degrees of freedom need to be adjusted to reflect the parameter estimation. For example, for an ARIMA(''p'',0,''q'') model, the degrees of freedom should be set to h - p - q.


Box–Pierce test

The Box–Pierce test uses the test statistic, in the notation outlined above, given by : Q_\text = n \sum_^h \hat^2_k, and it uses the same critical region as defined above. Simulation studies have shown that the distribution for the Ljung–Box statistic is closer to a \chi^2_ distribution than is the distribution for the Box–Pierce statistic for all sample sizes including small ones.


Implementations in statistics packages

* R: the Box.test function in the stats package *
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
: the acorr_ljungbox function in the statsmodels package * Julia: the Ljung–Box tests and the Box–Pierce tests in the ''HypothesisTests'' package *
SPSS SPSS Statistics is a statistical software suite developed by IBM for data management, advanced analytics, multivariate analysis, business intelligence, and criminal investigation. Long produced by SPSS Inc., it was acquired by IBM in 2009. Versi ...
: the Box-Ljung statistic is included by default in output produced by the IBM SPSS Statistics Forecasting module.


See also

* Q-statistic *
Wald–Wolfowitz runs test The Wald–Wolfowitz runs test (or simply runs test), named after statisticians Abraham Wald and Jacob Wolfowitz is a non-parametric statistical test that checks a randomness hypothesis for a two-valued data sequence. More precisely, it can be us ...
* Breusch–Godfrey test * Durbin–Watson test


References


Further reading

* * *


External links

{{DEFAULTSORT:Ljung-Box test Time series statistical tests Time domain analysis de:Box-Ljung-Test