Variance Diagnostics

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.

Variant declared firstOne predictor plus interceptNo variance verdict

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.

Entered

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.

Breusch-Pagan boundary: Koenker studentized maintains iid errors without normality; the original Breusch-Pagan form assumes normally distributed residuals. Both references remain asymptotic and conditional on the entered predictor and model residuals.

Auxiliary variance regression

Entered Residual Diagnostics 1.0.0.

Derived
Choose a variant and enter aligned rowsThe result will expose LM and F references, coefficients, R-squared and every fitted auxiliary response.

How the Breusch-Pagan and Koenker variants work

Koenker: LM = nR² from e² on [1, z]
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.

  1. The auxiliary R-squared is 0.11954621, producing LM 5.73821817 and chi-square reference probability 0.01659962.
  2. 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.

Comparison of residual questions, references, specifications and auxiliary regressions
DiagnosticPrimary questionOutput referenceDeclared specificationAuxiliary regression
Durbin–WatsonAdjacent residual-level movementStatistic only; design-dependent bounds withheldResidual orderNo
Ljung–BoxJoint residual autocorrelation through hChi-square upper-tail referenceMaximum lag and fitted ordersNo
Breusch–Pagan / KoenkerVariance related to entered predictorChi-square and F upper-tail referencesPredictor and variantYes
Engle ARCH LMSquared residuals related to own lagsChi-square and F upper-tail referencesLag and fitted correctionYes

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

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.

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.

XM

Review applicable statements, symbol specifications and execution terms.

Check XM terms

FBS

Confirm account-history and trading-cost conventions for your region.

Check FBS terms

FXOpen

Verify statement, charge and execution records before deriving inputs.

Check FXOpen terms

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.

Disclaimer: The results from this tool are estimates for educational and informational purposes only and may differ from your broker's figures. This is not financial or investment advice. Trading forex and CFDs carries a high level of risk and can result in the loss of all your capital. Always verify calculations with your broker and trade within your risk tolerance.