statsmodels.tsa.stattools.q_stat

statsmodels.tsa.stattools.q_stat(x, nobs)[source]

Compute Ljung-Box Q Statistic.

Parameters:
xarray_like

Array of autocorrelation coefficients. Can be obtained from acf.

nobsint, optional

Number of observations in the entire sample (ie., not just the length of the autocorrelation function results.

Returns:
q-statndarray

Ljung-Box Q-statistic for autocorrelation parameters.

p-valuendarray

P-value of the Q statistic.

See also

statsmodels.stats.diagnostic.acorr_ljungbox

Ljung-Box Q-test for autocorrelation in time series based on a time series rather than the estimated autocorrelation function.

Notes

Designed to be used with acf.


Last update: Dec 14, 2023