Diagnostics check whether a fitted model leaves structure in the residuals. They do not prove that a model is correct. They point to problems that should be investigated before trusting a forecast or an impulse response.
Implemented Checks
- ACF and PACF summarize serial dependence by lag.
- Ljung-Box tests whether autocorrelation up to a selected lag is jointly zero.
- Jarque-Bera tests skewness and kurtosis against a normal-residual benchmark.
- Engle ARCH-LM tests whether squared residuals show autoregressive conditional heteroskedasticity.
Numerical Notes
The tests run in TypeScript and use finite observations only. Chi-square tail probabilities use a Wilson-Hilferty approximation. This keeps the runtime small while giving stable values for typical macro sample sizes.
Interpretation
Failed diagnostics are not automatic rejection of a model. They are warnings about residual behavior. Serial correlation can point to missing lags or omitted predictors. ARCH effects can make constant-variance forecast bands too narrow. Non-normal residuals matter most when a workflow uses normal errors for intervals or approximate density bands.
API
See the Diagnostics API for request and response fields.
References
- Ljung and Box, 1978.
- Jarque and Bera, 1980.
- Engle, 1982.
- Wilson and Hilferty, 1931.