Finance14 min read·

Heteroscedasticity: What It Is & How to Handle It 2026

A clear explanation of heteroscedasticity - what it means for your regression models, how to detect it with the Breusch-Pagan and White tests, and practical fixes with Python code.

What Is Heteroscedasticity?

Heteroscedasticity occurs when the variance of error terms in a regression model isn't constant across observations. The word comes from Greek - "hetero" meaning different and "skedasis" meaning scatter. If you plot residuals against fitted values and the spread fans out or contracts, that's heteroscedasticity. It doesn't bias your coefficient estimates, but it makes your standard errors wrong, which means your hypothesis tests can't be trusted.

In a well-behaved regression, the residuals should look like a uniform band of random noise around zero - roughly the same width from left to right. That's homoscedasticity. Heteroscedasticity is the opposite: the residuals form a pattern, typically fanning out like a cone as the fitted values increase. Think of predicting household spending from income. Low-income households have relatively similar spending patterns, so the residuals are tight. High-income households vary wildly - some save heavily, others spend freely - so the residuals spread out. The variance of the error term depends on the level of the predictor.

This matters enormously in quantitative finance. Financial data is almost always heteroscedastic. Stock returns show volatility clustering - periods of calm followed by bursts of high volatility. Cross-sectional data on firms shows variance that grows with firm size. Interest rate changes show variance that depends on the level of rates. If you're fitting regression models to financial data in 2026 without accounting for heteroscedasticity, your confidence intervals and p-values are unreliable.

The formal heteroscedasticity definition is straightforward: in the classical linear regression model Y = X*beta + epsilon, heteroscedasticity means Var(epsilon_i) = sigma_i^2 rather than a single constant sigma^2 for all observations. Each observation has its own error variance.


Homoscedasticity vs Heteroscedasticity

Homoscedasticity means constant variance of the error terms across all observations. Heteroscedasticity means the variance changes. The distinction determines whether ordinary least squares (OLS) produces reliable inference - and it's one of the first things you should check after fitting any regression.

FeatureHomoscedasticityHeteroscedasticity
Error varianceConstant across all observationsChanges with the level of predictors or over time
Residual plot appearanceUniform band around zeroCone, fan, or other systematic pattern
OLS coefficient estimatesUnbiased and efficient (BLUE)Still unbiased, but no longer efficient
Standard errorsCorrect under OLS assumptionsIncorrect - typically underestimated
t-tests and F-testsValidUnreliable - may reject too often or too rarely
Confidence intervalsCorrectly sizedToo narrow or too wide
Typical in financial data?RareVery common

What the Residual Plots Look Like

Picture a scatter plot with fitted values on the x-axis and residuals on the y-axis.

Homoscedastic residuals look like a horizontal band of random points. The vertical spread is roughly the same whether you're at the left edge or the right edge of the plot. There's no discernible pattern - just evenly distributed noise.

Heteroscedastic residuals show a pattern in the spread. The most common shape is a funnel or megaphone - tight on the left, wide on the right (or vice versa). You might also see a bowtie shape (tight in the middle, wide at the extremes) or a periodic pattern where variance rises and falls systematically. Any systematic change in the vertical spread signals heteroscedasticity.

In practice, the funnel pattern is by far the most common. When predicting a variable that's naturally bounded near zero on the low end but unconstrained on the high end - revenue, asset returns, housing prices - the errors almost always grow with the predicted value.


Why Heteroscedasticity Matters

Heteroscedasticity doesn't bias OLS coefficient estimates - they remain unbiased and consistent. But it destroys their efficiency and makes the estimated standard errors wrong. This means your t-statistics, p-values, confidence intervals, and F-tests are all unreliable, even though the point estimates themselves are fine.

Here's the precise problem. OLS assumes constant variance to derive the formula for standard errors. When variance isn't constant, that formula produces the wrong numbers. Specifically:

OLS estimators are no longer BLUE. The Gauss-Markov theorem says OLS is the Best Linear Unbiased Estimator when all its assumptions hold - including homoscedasticity. Break that assumption and OLS is still unbiased, but it's no longer the most efficient linear estimator. There exists a better estimator (weighted least squares) that produces smaller standard errors. You're leaving precision on the table.

Standard errors are biased. This is the critical issue. If the heteroscedasticity follows the typical funnel pattern, OLS standard errors tend to be too small for coefficients associated with high-variance observations and too large for those associated with low-variance observations. The net effect depends on the specific pattern, but the result is the same: you can't trust the uncertainty estimates.

Hypothesis tests give misleading results. Since t-statistics divide the coefficient by the standard error, wrong standard errors produce wrong t-statistics. You might find a coefficient "statistically significant" when it isn't, or miss a genuine effect because the inflated standard error drowns out the signal. In quantitative trading, this can lead to false confidence in a factor that doesn't actually predict returns, or dismissal of one that does.

Confidence intervals have wrong coverage. A 95% confidence interval that claims 95% coverage might actually cover the true parameter only 80% of the time - or 99% of the time. You don't know which way it's wrong without diagnosing the heteroscedasticity pattern.

The coefficients themselves are still your best linear unbiased estimates. But all the inferential machinery built around them - everything that tells you whether your results are statistically meaningful - is compromised.


Common Causes of Heteroscedasticity

Heteroscedasticity typically arises from the underlying data-generating process rather than from model misspecification. Understanding the cause helps you choose the right remedy. In finance, four patterns appear repeatedly.

Volatility Clustering

Financial returns exhibit volatility clustering - large price moves tend to follow large price moves, and calm periods persist. This is the defining feature of financial time series and the reason GARCH models exist. If you're regressing returns on some factor over time, the residual variance isn't constant. It's low during quiet markets and high during crises. This is heteroscedasticity in its purest form, and it's present in virtually every time series of asset returns.

Firm Size Effects

In cross-sectional regressions, larger firms often have more variable outcomes in absolute terms. Regressing annual revenue growth on market capitalisation, you'll find that small firms cluster tightly while large firms show enormous variation. A small firm might grow at 5-15%, while a firm with GBP 100 billion in revenue could grow at -10% or +30%. The variance scales with the level of the variable.

Time-Varying Risk

Risk premia change over time. During periods of economic stress, expected returns and their variance both increase. If you estimate a constant-parameter model over a sample that includes both calm and turbulent periods, the residuals will show higher variance during the turbulent stretches. This is particularly relevant for factor models estimated over long historical samples.

Scale Effects and Omitted Variables

Sometimes heteroscedasticity signals a missing variable. If the variance of your residuals correlates with an observable variable that you haven't included in the model, adding that variable can reduce or eliminate the heteroscedasticity. More commonly in finance, the scale of the dependent variable drives heteroscedasticity - errors in predicting a stock priced at GBP 500 are naturally larger in absolute terms than errors for a stock priced at GBP 5.


How to Detect Heteroscedasticity

Detection starts with visual inspection of residual plots and is confirmed using formal statistical tests. The visual check is quick and intuitive. The tests provide statistical evidence and are essential for reporting results in 2026.

Residual Plots

Plot the residuals (or squared residuals) against the fitted values and each predictor variable. Look for any systematic pattern in the vertical spread. A funnel shape is the classic indicator, but any non-constant spread - widening, narrowing, or oscillating - signals heteroscedasticity. This should be your first diagnostic after every regression. It takes thirty seconds and catches the obvious cases.

The Breusch-Pagan Test

The Breusch-Pagan test checks whether the variance of the residuals is related to the independent variables. It works by regressing the squared residuals on the original regressors and testing whether the resulting R-squared is significantly different from zero.

The procedure:

  1. Fit the original regression and obtain the residuals e_i.
  2. Square the residuals to get e_i^2.
  3. Regress e_i^2 on the original independent variables.
  4. The test statistic is n * R^2 from this auxiliary regression, distributed as chi-squared with p degrees of freedom (where p is the number of predictors).
  5. A small p-value (typically below 0.05) rejects the null of homoscedasticity.

The Breusch-Pagan test assumes the relationship between variance and the predictors is linear. If the heteroscedasticity follows a nonlinear pattern, the test may miss it.

The White Test

The White test is more general than Breusch-Pagan because it doesn't assume a specific functional form for the heteroscedasticity. It regresses squared residuals on the original predictors, their squares, and all cross-products.

The procedure:

  1. Fit the original regression and obtain the residuals e_i.
  2. Square the residuals.
  3. Regress e_i^2 on the original predictors, their squared terms, and all pairwise interaction terms.
  4. The test statistic is n * R^2 from this auxiliary regression, distributed as chi-squared.
  5. A small p-value rejects homoscedasticity.

The White test catches both linear and nonlinear heteroscedasticity, making it a safer default choice. The trade-off is that it uses more degrees of freedom (many regressors in the auxiliary regression), which can reduce power with small samples.

The Goldfeld-Quandt Test

The Goldfeld-Quandt test takes a different approach. It splits the data into two groups - one where variance is expected to be low and one where it's expected to be high - and compares the residual variances.

  1. Order the observations by the suspected source of heteroscedasticity (e.g. firm size).
  2. Split the sample into a low group and a high group, often dropping the middle third.
  3. Run the regression separately on each group and compute the residual sum of squares for each.
  4. The test statistic is the ratio of the larger RSS to the smaller RSS, following an F-distribution.

This test is intuitive and works well when you have a clear hypothesis about what's driving the heteroscedasticity. It's less useful when the source is unknown or when variance doesn't simply increase monotonically with a single variable.


Testing for Heteroscedasticity in Python

Here's how to run the Breusch-Pagan and White tests using statsmodels. This is the standard approach for heteroscedasticity testing in Python, and it takes just a few lines of code.

import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.stats.diagnostic import het_breuschpagan, het_white np.random.seed(42) n = 500 # Generate data with heteroscedasticity: # variance of the error term increases with x x = np.random.uniform(1, 100, n) error_std = 0.5 * x # standard deviation grows linearly with x y = 10 + 2.5 * x + np.random.normal(0, error_std, n) X = sm.add_constant(x) model = sm.OLS(y, X).fit() print("=== OLS Regression Results ===") print(f"Intercept: {model.params[0]:.4f}") print(f"Slope: {model.params[1]:.4f}") print(f"R-squared: {model.rsquared:.4f}") print() # --- Breusch-Pagan test --- bp_stat, bp_pvalue, bp_fstat, bp_f_pvalue = het_breuschpagan( model.resid, model.model.exog ) print("=== Breusch-Pagan Test ===") print(f"LM statistic: {bp_stat:.4f}") print(f"p-value: {bp_pvalue:.6f}") print(f"F-statistic: {bp_fstat:.4f}") print(f"F p-value: {bp_f_pvalue:.6f}") print(f"Conclusion: {'Heteroscedastic' if bp_pvalue < 0.05 else 'Homoscedastic'}") print() # --- White test --- white_stat, white_pvalue, white_fstat, white_f_pvalue = het_white( model.resid, model.model.exog ) print("=== White Test ===") print(f"LM statistic: {white_stat:.4f}") print(f"p-value: {white_pvalue:.6f}") print(f"F-statistic: {white_fstat:.4f}") print(f"F p-value: {white_f_pvalue:.6f}") print(f"Conclusion: {'Heteroscedastic' if white_pvalue < 0.05 else 'Homoscedastic'}")

In the example above, we deliberately generate data where the error variance grows linearly with x. Both tests should reject the null hypothesis of homoscedasticity with a very small p-value.

A few things worth knowing about these tests:

  • The Breusch-Pagan test in statsmodels (het_breuschpagan) requires you to pass the residuals and the design matrix (including the constant). It tests for a linear relationship between the squared residuals and the regressors.
  • The White test (het_white) automatically constructs the squared and cross-product terms internally. You just pass the residuals and the original design matrix.
  • Both return four values: the LM statistic, its p-value, an equivalent F-statistic, and the F p-value. The LM version uses the chi-squared distribution; the F version is a small-sample correction. For large samples, they'll agree closely.

Visualising the Residuals

You can also plot the residuals to see the heteroscedasticity pattern directly.

import matplotlib.pyplot as plt fig, axes = plt.subplots(1, 2, figsize=(12, 5)) # Residuals vs fitted values axes[0].scatter(model.fittedvalues, model.resid, alpha=0.4, s=10) axes[0].axhline(y=0, color="red", linestyle="--") axes[0].set_xlabel("Fitted Values") axes[0].set_ylabel("Residuals") axes[0].set_title("Residuals vs Fitted Values") # Squared residuals vs predictor axes[1].scatter(x, model.resid ** 2, alpha=0.4, s=10) axes[1].set_xlabel("x") axes[1].set_ylabel("Squared Residuals") axes[1].set_title("Squared Residuals vs x") plt.tight_layout() plt.savefig("heteroscedasticity_diagnostic.png", dpi=150) plt.show()

The left panel will show the classic funnel pattern - residuals fanning out as fitted values increase. The right panel shows the squared residuals increasing with x, confirming that the error variance is a function of the predictor. This visual evidence, combined with the formal tests, gives you a complete diagnostic picture.


How to Fix Heteroscedasticity

There's no single universal fix. The right approach depends on the form of heteroscedasticity and the goal of your analysis. The four most common remedies are robust standard errors, weighted least squares, log transformations, and GARCH models for time series.

Robust Standard Errors (White Standard Errors)

If you only need correct inference - valid p-values and confidence intervals - without changing the coefficient estimates, robust standard errors are the simplest solution. Halbert White developed heteroscedasticity-consistent (HC) standard errors that remain valid regardless of the form of heteroscedasticity. The coefficients stay the same; only the standard errors change.

import statsmodels.api as sm # Fit OLS with robust (HC3) standard errors robust_model = sm.OLS(y, X).fit(cov_type="HC3") print("=== Robust Standard Errors (HC3) ===") print(robust_model.summary().tables[1]) print() # Compare standard errors: OLS vs Robust print("Standard Error Comparison:") print(f" OLS SE (slope): {model.bse[1]:.4f}") print(f" Robust SE (slope): {robust_model.bse[1]:.4f}") print(f" Ratio: {robust_model.bse[1] / model.bse[1]:.2f}x")

In the presence of heteroscedasticity, the robust standard errors will typically be larger than the naive OLS standard errors. This means some coefficients that appeared significant under OLS may lose significance once you correct the standard errors - which is exactly the point. You're removing false positives.

The HC3 variant is the default recommendation for samples under a few thousand observations. For large samples, HC0 and HC1 work well too. In 2026, there's little reason not to use robust standard errors by default in cross-sectional regressions.

Weighted Least Squares (WLS)

If you know (or can estimate) the form of the heteroscedasticity, weighted least squares produces more efficient estimates than OLS. WLS gives less weight to observations with high variance and more weight to observations with low variance, effectively standardising the residuals.

# If we know variance is proportional to x^2, # the weights are 1 / x^2 weights = 1.0 / (x ** 2) wls_model = sm.WLS(y, X, weights=weights).fit() print("=== Weighted Least Squares ===") print(f"Intercept: {wls_model.params[0]:.4f}") print(f"Slope: {wls_model.params[1]:.4f}") print(f"SE (slope): {wls_model.bse[1]:.4f}")

WLS requires you to specify the weights, which means you need to know how the variance depends on the predictors. In our generated example, we know the standard deviation is proportional to x, so the variance is proportional to x^2 and the weights are 1/x^2. In practice, you often estimate the variance function from the data - for instance, by regressing the log of squared residuals on the predictors and using the fitted values to construct weights.

The advantage of WLS over robust standard errors is efficiency: WLS produces smaller standard errors because it uses the information about the variance structure. The disadvantage is that if you get the weights wrong, the results can be worse than plain OLS.

Log Transformation

When the heteroscedasticity follows a multiplicative pattern - errors that are proportional to the level of the dependent variable - taking the logarithm of the dependent variable can stabilise the variance.

# Log-transform the dependent variable y_positive = np.maximum(y, 1e-6) # ensure positive values log_y = np.log(y_positive) log_model = sm.OLS(log_y, X).fit() bp_log = het_breuschpagan(log_model.resid, log_model.model.exog) print("=== Log-Transformed Model ===") print(f"BP p-value (original): {bp_pvalue:.6f}") print(f"BP p-value (log): {bp_log[1]:.6f}")

Log transformation works well when the data is strictly positive and the relationship is multiplicative. It changes the interpretation of the coefficients - they now represent percentage changes rather than absolute changes - but this is often a more natural framing for financial and economic variables anyway.

Don't apply log transformations mechanically. If the heteroscedasticity doesn't follow a multiplicative pattern, the transformation won't help and may introduce new problems.

GARCH Models for Time Series

When heteroscedasticity appears in time series data as volatility clustering - which is the norm for financial returns - GARCH (Generalised Autoregressive Conditional Heteroscedasticity) models are the standard tool. Rather than treating heteroscedasticity as a nuisance to be corrected, GARCH models it directly as a feature of the data-generating process.

from arch import arch_model np.random.seed(42) n_days = 1000 # Simulate returns with volatility clustering returns = np.random.normal(0, 1, n_days) sigma = np.ones(n_days) for t in range(1, n_days): sigma[t] = np.sqrt( 0.00001 + 0.08 * returns[t - 1] ** 2 + 0.90 * sigma[t - 1] ** 2 ) returns[t] = sigma[t] * np.random.normal() returns_series = pd.Series(returns * 100, name="returns") # Fit a GARCH(1,1) model garch = arch_model(returns_series, vol="Garch", p=1, q=1, mean="Constant") result = garch.fit(disp="off") print("=== GARCH(1,1) Results ===") print(f"omega (constant): {result.params['omega']:.6f}") print(f"alpha (ARCH): {result.params['alpha[1]']:.4f}") print(f"beta (GARCH): {result.params['beta[1]']:.4f}") print(f"Persistence: {result.params['alpha[1]'] + result.params['beta[1]']:.4f}")

The GARCH(1,1) model specifies that today's conditional variance depends on yesterday's squared return (the ARCH term) and yesterday's conditional variance (the GARCH term). High persistence (alpha + beta close to 1) means volatility shocks dissipate slowly - a hallmark of financial return series.

GARCH connects directly to more advanced models like the Heston stochastic volatility model, which is the continuous-time analogue used extensively in option pricing. If you're working with financial time series, GARCH isn't just a fix for heteroscedasticity - it's a substantive model of how volatility behaves.


Heteroscedasticity in Financial Data

Financial returns are almost always heteroscedastic. This isn't an occasional inconvenience - it's a fundamental property of how markets work. Understanding this is essential for anyone building quantitative models in 2026.

Why Financial Returns Are Heteroscedastic

Several mechanisms generate heteroscedasticity in financial data:

Information arrives in clusters. Markets react to earnings announcements, central bank decisions, and geopolitical events. These events create bursts of volatility followed by quieter periods as the new information is digested. The result is volatility clustering - the defining feature of financial return heteroscedasticity.

Asymmetric volatility (the asymmetric effect). Bad news tends to increase volatility more than good news of the same magnitude. A 5% market drop typically triggers more subsequent volatility than a 5% rally. This asymmetry means variance isn't just non-constant - it responds differently to positive and negative shocks.

Market microstructure. At high frequencies, bid-ask bounce, discrete tick sizes, and variable liquidity all contribute to non-constant variance. Intraday volatility follows well-documented patterns - high at the open, lower mid-day, rising again near the close.

Regime changes. The statistical properties of returns differ between bull markets, bear markets, and crisis periods. A model estimated over a sample spanning multiple regimes will show heteroscedastic residuals because the variance isn't constant across these different environments.

The GARCH Connection

The GARCH family of models was developed specifically to capture heteroscedasticity in financial time series. Robert Engle's original ARCH model (1982) and Tim Bollerslev's GARCH generalisation (1986) remain among the most cited papers in econometrics because they addressed such a fundamental property of financial data.

In 2026, GARCH models and their extensions - EGARCH for asymmetric effects, GJR-GARCH for threshold effects, and multivariate variants like DCC-GARCH for portfolio applications - are standard tools on every quantitative desk. They don't just correct for heteroscedasticity; they produce volatility forecasts that feed into risk management, position sizing, and option pricing.

Practical Implications

When working with financial data, assume heteroscedasticity is present until proven otherwise. This has several practical consequences:

  • Always use robust standard errors for cross-sectional regressions, or better yet, use clustered standard errors when observations share common factors.
  • Use GARCH or similar models for time series work, rather than assuming constant-variance OLS residuals.
  • Be cautious with backtests that assume constant transaction costs or constant signal volatility. The time-varying nature of variance means strategy performance is inherently non-stationary.
  • Report heteroscedasticity-consistent test statistics in any research. Reviewers and practitioners in 2026 expect this as standard practice.

Frequently Asked Questions

What is the simple definition of heteroscedasticity?

Heteroscedasticity means the variability of your data isn't uniform. In a regression context, it means the errors (residuals) have different amounts of spread for different values of the independent variable. Imagine predicting house prices from square footage. For small houses, predictions might be off by GBP 10,000 either way. For mansions, predictions might be off by GBP 500,000. That increasing spread in prediction errors is heteroscedasticity. The word literally translates from Greek as "different scatter." It's the opposite of homoscedasticity, where the error spread stays constant regardless of the predictor values.

How do you test for heteroscedasticity?

The two most common formal tests are the Breusch-Pagan test and the White test. The Breusch-Pagan test regresses squared residuals on the original predictors and checks if the R-squared is significantly different from zero. The White test does the same but includes squared terms and cross-products, making it sensitive to nonlinear patterns. Both produce a p-value - if it's below your significance threshold (typically 0.05), you reject homoscedasticity. Before running formal tests, always plot residuals against fitted values. A funnel or cone shape is the visual signature of heteroscedasticity and can be spotted in seconds.

What is the difference between the Breusch-Pagan test and the White test?

The Breusch-Pagan test assumes that heteroscedasticity, if present, is a linear function of the independent variables. The White test makes no such assumption - it includes squared terms and interaction terms in the auxiliary regression, allowing it to detect nonlinear patterns of heteroscedasticity. This makes the White test more general and a safer default choice. The trade-off is statistical power: the White test uses more degrees of freedom (more parameters in the auxiliary regression), so with small samples it may fail to detect heteroscedasticity that the Breusch-Pagan test would catch. For most practical applications with reasonable sample sizes, the White test is preferred.

Does heteroscedasticity bias regression coefficients?

No. This is a common misconception. Heteroscedasticity does not bias OLS coefficient estimates - they remain unbiased and consistent. The problem is with the standard errors, not the coefficients themselves. When heteroscedasticity is present, the OLS formula for standard errors gives incorrect values. This means your t-statistics, p-values, and confidence intervals are all wrong. You might conclude a variable is statistically significant when it isn't, or miss a genuinely important predictor. The fix is straightforward: use robust (heteroscedasticity-consistent) standard errors, which remain valid regardless of the variance structure.

What is the best way to fix heteroscedasticity?

It depends on your goal and data type. For cross-sectional regressions where you mainly need correct inference, robust standard errors (HC3 variant) are the simplest and most widely recommended approach - they fix your p-values and confidence intervals without changing the model. If you want more efficient estimates and know the variance structure, weighted least squares (WLS) gives tighter standard errors. For data where variance is proportional to the level of the dependent variable, a log transformation can stabilise the variance. For financial time series with volatility clustering, GARCH models are the standard - they model the heteroscedasticity directly rather than treating it as a nuisance. In practice, robust standard errors should be your default for any cross-sectional regression in 2026.

Is heteroscedasticity always a problem?

Not always. If your only goal is prediction - getting the best fitted values without caring about inference - heteroscedasticity doesn't bias your predictions. OLS still minimises the sum of squared residuals and the coefficients remain unbiased. It becomes a problem when you need to make statistical claims: testing whether a coefficient is significantly different from zero, constructing confidence intervals, or comparing nested models with F-tests. In quantitative finance, you almost always need reliable inference - knowing whether a signal is genuinely predictive or just noise. So in practice, heteroscedasticity is almost always something you need to address, either by correcting the standard errors or by modelling the variance structure explicitly.

Want to go deeper on Heteroscedasticity: What It Is & How to Handle It 2026?

This article covers the essentials, but there's a lot more to learn. Inside Quantt, you'll find hands-on coding exercises, interactive quizzes, and structured lessons that take you from fundamentals to production-ready skills — across 50+ courses in technology, finance, and mathematics.

Free to get started · No credit card required