The Ljung-Box test is a portmanteau test for whether a group of time-series autocorrelations
is zero. For a series of length , using the first
sample autocorrelations
, its statistic is
Under the null hypothesis of no autocorrelation, the statistic is approximately chi-squared distributed. When the statistic is computed from fitted-model residuals, the degrees of freedom are commonly reduced by the number of estimated autoregressive and moving-average parameters. The statistic is a finite-sample modification of the Box-Pierce test.