statsmodels.stats.diagnostic.acorr_lm(resid, nlags=None, store=False, *, period=None, ddof=0, cov_type='nonrobust', cov_kwargs=None)[source]

Lagrange Multiplier tests for autocorrelation.

This is a generic Lagrange Multiplier test for autocorrelation. Returns Engle’s ARCH test if resid is the squared residual array. Breusch-Godfrey is a variation on this test with additional exogenous variables.


Time series to test.

nlagsint, default None

Highest lag to use.

storebool, default False

If true then the intermediate results are also returned.

periodint, default none

The period of a Seasonal time series. Used to compute the max lag for seasonal data which uses min(2*period, nobs // 5) if set. If None, then the default rule is used to set the number of lags. When set, must be >= 2.

ddofint, default 0

The number of degrees of freedom consumed by the model used to produce resid. The default value is 0.

cov_typestr, default “nonrobust”

Covariance type. The default is “nonrobust` which uses the classic OLS covariance estimator. Specify one of “HC0”, “HC1”, “HC2”, “HC3” to use White’s covariance estimator. All covariance types supported by are accepted.

cov_kwargsdict, default None

Dictionary of covariance options passed to See for more details.


Lagrange multiplier test statistic.


The p-value for Lagrange multiplier test.


The f statistic of the F test, alternative version of the same test based on F test for the parameter restriction.


The pvalue of the F test.

res_storeResultsStore, optional

Intermediate results. Only returned if store=True.

See also


Conditional heteroskedasticity testing.


Breusch-Godfrey test for serial correlation.


Ljung-Box test for serial correlation.


The test statistic is computed as (nobs - ddof) * r2 where r2 is the R-squared from a regression on the residual on nlags lags of the residual.