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 lag=12*(nobs/100)^{1/4}.
- 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.
- lags
- Returns
- output
DataFrame
DataFrame containing three columns: the test statistic, the p-value of the test, and the degree of freedom used in the test.
- output
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.