Breusch-Pagan / Koenker Test Calculator
Enter aligned regression residuals and one predictor suspected of explaining their variance, then choose the Koenker studentized or original Breusch-Pagan convention. The calculator returns LM and F references plus the full auxiliary regression without labeling the model homoskedastic, heteroskedastic, safe or tradeable.
Enter residuals and one variance predictor
Rows must align one-for-one. The page inserts an intercept and does not select, transform or add predictors.
Koenker maintains iid errors; original Breusch-Pagan additionally maintains normal residuals.
Enter 20 to 500 finite residuals without percent signs, oldest to newest, from one fitted model.
Enter one nonconstant predictor value for every residual row. The page adds the intercept.
Auxiliary variance regression
Entered Residual Diagnostics 1.0.0.
On smaller screens, scroll horizontally to inspect the complete audit table.
| Row | Residual | Residual squared | Predictor | Auxiliary response | Fitted response | Auxiliary residual |
|---|
How the Breusch-Pagan and Koenker variants work
Original BP: LM = ESS ÷ 2 from (e² ÷ mean(e²)) on [1, z]
Both variants fit an ordinary-least-squares auxiliary regression using one implicit constant and the one entered variance predictor. Koenker uses squared residuals as the response and multiplies auxiliary R-squared by n.
The original Breusch-Pagan variant first divides squared residuals by their mean and then divides the auxiliary explained sum of squares by two. That form maintains residual normality; the interface makes the assumption change visible before calculation.
The LM reference uses the upper tail of chi-square with one degree of freedom. The same auxiliary regression also supplies an F statistic with one numerator and n minus two denominator degrees of freedom. Small-sample interpretation remains the user’s responsibility.
Worked example from the audited fixture
The governed fixture aligns 48 residuals with a standardized sequence predictor and defaults to Koenker studentized.
- The auxiliary R-squared is 0.11954621, producing LM 5.73821817 and chi-square reference probability 0.01659962.
- The companion F statistic is 6.24578578 with probability 0.01608108. Switching to original Breusch-Pagan produces LM 6.33975581 under its normality assumption.
Reproduce it: select “Load audited example” above. The governed engine retains full precision and rounds only the visible interface.
How to interpret the result
- Start with the variant. Koenker and original Breusch-Pagan use different LM arithmetic and assumptions even when the same rows are entered.
- A smaller upper-tail reference probability places the observed statistic farther from the maintained constant-variance null, but the page does not turn that reference into a binary model verdict.
- The predictor coefficient describes the fitted direction of the auxiliary response against the one entered predictor. It is not a forecast of future variance.
- Predictor choice matters. Trying many predictors and reporting only the most favorable output introduces unreported specification search and multiple-testing risk.
- The statsmodels documentation notes that LM significance can be exaggerated in small or moderately large samples; the F reference is exposed rather than hidden.
Assumptions and limits
- Enter 20 to 500 equal-length residual and predictor values aligned to the same observations.
- The predictor must vary. Constant or mismatched series fail closed instead of producing a misleading regression.
- The page cannot verify that residuals came from an appropriate model, that the predictor belongs in the variance equation or that iid or normality assumptions hold.
- Version 1.0.0 supports one predictor plus an implicit intercept. White tests, interactions, squares and arbitrary design matrices are outside scope.
- Asymptotic chi-square and F references can be unreliable with dependence, misspecification, influential outliers, structural breaks or selected samples.
- No homoskedasticity, heteroskedasticity, model-adequacy, volatility forecast, predictive-edge, strategy-validation, grade, signal, position instruction or recommendation verdict is generated.
Which residual diagnostic answers which question?
These four diagnostics do not create one interchangeable model-quality score. They use residual levels or squares, different regressors and different reference systems. Keep the data transformation, maintained null and selected specification visible before interpreting any statistic or probability.
| Diagnostic | Primary question | Output reference | Declared specification | Auxiliary regression |
|---|---|---|---|---|
| Durbin–Watson | Adjacent residual-level movement | Statistic only; design-dependent bounds withheld | Residual order | No |
| Ljung–Box | Joint residual autocorrelation through h | Chi-square upper-tail reference | Maximum lag and fitted orders | No |
| Breusch–Pagan / Koenker | Variance related to entered predictor | Chi-square and F upper-tail references | Predictor and variant | Yes |
| Engle ARCH LM | Squared residuals related to own lags | Chi-square and F upper-tail references | Lag and fitted correction | Yes |
Frequently asked questions
- It fits an auxiliary regression that relates entered squared residuals to one aligned predictor under a declared Koenker or original Breusch-Pagan convention.
- It uses squared residuals as the auxiliary response and calculates LM as the observation count times auxiliary R-squared.
- It scales squared residuals by their mean and calculates LM as half the auxiliary explained sum of squares while maintaining normally distributed residuals.
- The studentized form maintains iid errors without the original test’s residual-normality assumption, matching the current statsmodels default.
- The statsmodels documentation notes that the LM reference can exaggerate significance in small or moderately large samples, where the auxiliary F reference may be preferable.
- No. Version 1.0.0 supports one explicit predictor plus an implicit intercept so the design and one degree of freedom remain transparent.
- No. The asymptotic reference remains conditional on residual provenance, predictor choice, maintained assumptions, sample selection and model specification.
- No. It generates no homoskedasticity or heteroskedasticity verdict, volatility forecast, grade, signal, position instruction or recommendation.
Sources and methodology
- statsmodels — Breusch-Pagan — Official documentation and implementation notes for Koenker and original Breusch-Pagan variants.
- Breusch and Pagan (1979) — Original Econometrica paper defining the LM test for heteroskedasticity.
- Koenker (1981) — Primary paper defining the studentized alternative to the original test.
Version 1.0.0 was locked after its statistics, reference probabilities, auxiliary coefficients and worked examples were independently recomputed with statsmodels 0.14.6 and SciPy 1.13.1. The browser calculator performs local arithmetic and does not upload entered observations. Reference probabilities remain conditional on the disclosed model and data assumptions.
Separate variance level from variance persistence
Verify the source model before testing its residuals
Reconcile the exact symbol, fitted equation, observation timestamps, timezone, frequency, missing rows, spread, commission, financing, currency conversion, rollover adjustments and preprocessing before entering residuals. Correct diagnostic arithmetic cannot repair a misspecified, selected, misaligned or cost-inconsistent source model.
Risk and affiliate disclosure: Leveraged forex and CFD trading can result in substantial losses. These are affiliate links, so ForexMT4Indicators.com may receive compensation if you register or trade through them, at no additional cost to you. Availability and terms vary by jurisdiction and broker entity.

