Separate dependence, changing variance and parameter breaks
For residuals , the Ljung–Box statistic over lags uses the estimated autocorrelations :
An OLS-residual CUSUM standardises cumulative residuals and looks for excursions from the range expected under parameter stability. For a known break date, a regression with post-event indicators and interactions gives interpretable estimates of intercept and slope changes. Selecting a date after inspecting the same series changes the testing problem. An unknown-break test and error assumptions that match the data are important.
A break can masquerade as persistent dependence. Suppose volatility is low for half the sample and high thereafter. The squared residuals are likely to cluster by regime even if they are independent within each regime. A significant ARCH test in that sample is a reason to investigate, not evidence that a single stationary recursion explains the whole period. Check whether the model fits both sides of a candidate break and whether the date was chosen on the training sample. If you look for the most dramatic date after seeing the data, account for that search in your interpretation.
Residual tests in Python
This synthetic series has a known change in mean and constant innovation variance. Try setting the shift to zero to compare the diagnostics.
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.diagnostic import (
acorr_ljungbox, breaks_cusumolsresid, het_arch,
)
rng = np.random.default_rng(18)
returns = rng.normal(0, 1, 600)
returns[300:] += 0.45
fit = sm.OLS(returns, np.ones((len(returns), 1))).fit()
print(acorr_ljungbox(fit.resid, lags=[10, 20], model_df=0))
print("ARCH LM p-value:", het_arch(fit.resid, nlags=10)[1])
print("CUSUM p-value:", breaks_cusumolsresid(fit.resid, ddof=1)[1])