statsmodels.tsa.ar_model.AutoRegResults.test_serial_correlation¶
- AutoRegResults.test_serial_correlation(lags=None, model_df=None)[source]¶
Ljung-Box test for residual serial correlation
- Parameters:
lags (int) – The maximum number of lags to use in the test. Jointly tests that all autocorrelations up to and including lag j are zero for j = 1, 2, …, lags. If None, uses min(10, nobs // 5).
model_df (int) – The model degree of freedom to use when adjusting computing the test statistic to account for parameter estimation. If None, uses the number of AR lags included in the model.
- Returns:
output – DataFrame containing three columns: the test statistic, the p-value of the test, and the degree of freedom used in the test.
- Return type:
DataFrame
Notes
Null hypothesis is no serial correlation.
The the test degree-of-freedom is 0 or negative once accounting for model_df, then the test statistic’s p-value is missing.
See also
statsmodels.stats.diagnostic.acorr_ljungboxLjung-Box test for serial correlation.