fbpx
Wikipedia

Ljung–Box test

The Ljung–Box test /juːng-bɑks/ (audio) (named for Greta M. Ljung and George E. P. Box) is a type of statistical test of whether any of a group of autocorrelations of a time series are different from zero. Instead of testing randomness at each distinct lag, it tests the "overall" randomness based on a number of lags, and is therefore a portmanteau test.

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 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,[1][2] 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.[3]

The Ljung–Box test is widely applied in econometrics and other applications of time series analysis. A similar assessment can be also carried out with the Breusch–Godfrey test and the Durbin–Watson test.

Formal definition edit

The Ljung–Box test may be defined as:

 : The data are independently distributed (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).
 : The data are not independently distributed; they exhibit serial correlation.

The test statistic is:[2]

 

where n is the sample size,   is the sample autocorrelation at lag k, and h is the number of lags being tested. Under   the statistic Q asymptotically follows a  . For significance level α, the critical region for rejection of the hypothesis of randomness is:

 

where   is the (1 − α)-quantile[4] of the chi-squared distribution with h degrees of freedom.

The Ljung–Box test is commonly used in autoregressive integrated moving average (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  .[5]

Box–Pierce test edit

The Box–Pierce test uses the test statistic, in the notation outlined above, given by[1]

 

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   distribution than is the distribution for the Box–Pierce statistic for all sample sizes including small ones.[citation needed]

Implementations in statistics packages edit

  • R: the Box.test function in the stats package[6]
  • Python: the acorr_ljungbox function in the statsmodels package[7]
  • Julia: the Ljung–Box tests and the Box–Pierce tests in the HypothesisTests package[8]
  • SPSS: the Box-Ljung statistic is included by default in output produced by the IBM SPSS Statistics Forecasting module.

See also edit

References edit

  1. ^ a b Box, G. E. P.; Pierce, D. A. (1970). "Distribution of Residual Autocorrelations in Autoregressive-Integrated Moving Average Time Series Models". Journal of the American Statistical Association. 65 (332): 1509–1526. doi:10.1080/01621459.1970.10481180. JSTOR 2284333.
  2. ^ a b G. M. Ljung; G. E. P. Box (1978). "On a Measure of a Lack of Fit in Time Series Models". Biometrika. 65 (2): 297–303. doi:10.1093/biomet/65.2.297.
  3. ^ Davies, Neville; Newbold, Paul (1979). "Some power studies of a portmanteau test of time series model specification". Biometrika. 66 (1): 153–155. doi:10.1093/biomet/66.1.153.
  4. ^ Brockwell, Peter J.; Davis, Richard A.; Davis, R. J. (2002-03-08). Introduction to Time Series and Forecasting. Taylor & Francis. p. 36. ISBN 978-0-387-95351-9.
  5. ^ Davidson, James (2000). Econometric Theory. Blackwell. p. 162. ISBN 978-0-631-21584-4.
  6. ^ "R: Box–Pierce and Ljung–Box Tests". stat.ethz.ch. Retrieved 2016-06-05.
  7. ^ "Python: Ljung–Box Tests". statsmodels.org. Retrieved 2018-07-23.
  8. ^ "Time series tests". juliastats.org. Retrieved 2020-02-04.

Further reading edit

External links edit

  This article incorporates public domain material from the National Institute of Standards and Technology

ljung, test, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced, material, challenged, removed, find, sources, news, newspapers, books, scholar, jstor, june, 2011, le. This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Ljung Box test news newspapers books scholar JSTOR June 2011 Learn how and when to remove this template message The Ljung Box test juːng bɑks audio named for Greta M Ljung and George E P Box is a type of statistical test of whether any of a group of autocorrelations of a time series are different from zero Instead of testing randomness at each distinct lag it tests the overall randomness based on a number of lags and is therefore a portmanteau test 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 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 1 2 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 3 The Ljung Box test is widely applied in econometrics and other applications of time series analysis A similar assessment can be also carried out with the Breusch Godfrey test and the Durbin Watson test Contents 1 Formal definition 2 Box Pierce test 3 Implementations in statistics packages 4 See also 5 References 6 Further reading 7 External linksFormal definition editThe Ljung Box test may be defined as H0 displaystyle H 0 nbsp The data are independently distributed 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 Ha displaystyle H a nbsp The data are not independently distributed they exhibit serial correlation The test statistic is 2 Q n n 2 k 1hr k2n k displaystyle Q n n 2 sum k 1 h frac hat rho k 2 n k nbsp where n is the sample size r k displaystyle hat rho k nbsp is the sample autocorrelation at lag k and h is the number of lags being tested Under H0 displaystyle H 0 nbsp the statistic Q asymptotically follows a x h 2 displaystyle chi h 2 nbsp For significance level a the critical region for rejection of the hypothesis of randomness is Q gt x1 a h2 displaystyle Q gt chi 1 alpha h 2 nbsp where x1 a h2 displaystyle chi 1 alpha h 2 nbsp is the 1 a quantile 4 of the chi squared distribution with h degrees of freedom The Ljung Box test is commonly used in autoregressive integrated moving average 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 displaystyle h p q nbsp 5 Box Pierce test editThe Box Pierce test uses the test statistic in the notation outlined above given by 1 QBP n k 1hr k2 displaystyle Q text BP n sum k 1 h hat rho k 2 nbsp 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 x h 2 displaystyle chi h 2 nbsp distribution than is the distribution for the Box Pierce statistic for all sample sizes including small ones citation needed Implementations in statistics packages editR the Box test function in the stats package 6 Python the acorr ljungbox function in the statsmodels package 7 Julia the Ljung Box tests and the Box Pierce tests in the HypothesisTests package 8 SPSS the Box Ljung statistic is included by default in output produced by the IBM SPSS Statistics Forecasting module See also editQ statistic Wald Wolfowitz runs test Breusch Godfrey test Durbin Watson testReferences edit a b Box G E P Pierce D A 1970 Distribution of Residual Autocorrelations in Autoregressive Integrated Moving Average Time Series Models Journal of the American Statistical Association 65 332 1509 1526 doi 10 1080 01621459 1970 10481180 JSTOR 2284333 a b G M Ljung G E P Box 1978 On a Measure of a Lack of Fit in Time Series Models Biometrika 65 2 297 303 doi 10 1093 biomet 65 2 297 Davies Neville Newbold Paul 1979 Some power studies of a portmanteau test of time series model specification Biometrika 66 1 153 155 doi 10 1093 biomet 66 1 153 Brockwell Peter J Davis Richard A Davis R J 2002 03 08 Introduction to Time Series and Forecasting Taylor amp Francis p 36 ISBN 978 0 387 95351 9 Davidson James 2000 Econometric Theory Blackwell p 162 ISBN 978 0 631 21584 4 R Box Pierce and Ljung Box Tests stat ethz ch Retrieved 2016 06 05 Python Ljung Box Tests statsmodels org Retrieved 2018 07 23 Time series tests juliastats org Retrieved 2020 02 04 Further reading editBrockwell Peter Davis Richard 2002 Introduction to Time Series and Forecasting 2nd ed Springer pp 35 38 ISBN 978 0 387 94719 8 Enders Walter 2010 Applied Econometric Time Series Third ed New York Wiley pp 69 70 ISBN 978 0470 50539 7 Hayashi Fumio 2000 Econometrics Princeton University Press pp 142 144 ISBN 978 0 691 01018 2 External links edit nbsp This article incorporates public domain material from the National Institute of Standards and Technology Retrieved from https en wikipedia org w index php title Ljung Box test amp oldid 1215740699, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.