{
  "id": "homoscedasticity",
  "title": "Homoscedasticity",
  "lang": "en",
  "source_lang": "en",
  "summary": "Homoscedasticity is the condition that random errors or outcomes have the same variance across observations, groups, or values of explanatory variables.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "Homoskedasticity",
    "Constant variance",
    "Homogeneity of variance"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/homoscedasticity/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/homoscedasticity/",
      "json": "https://aiwiki.page/zh/homoscedasticity.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Homoscedasticity is the property that a specified variance remains constant across observations, groups, or values of explanatory variables. In statistics, it most often describes the errors in a regression model: their conditional variance does not depend on the predictors. Its opposite is heteroscedasticity, in which that variance changes. Homoscedasticity is an important assumption behind conventional regression standard errors and several classical statistical tests, but it is distinct from assumptions about normality, independence, or the correctness of a model’s conditional mean."
    },
    {
      "heading": "Definition",
      "text": "For a response variable \\(Y\\) and a vector of predictors \\(X\\), consider the model\n\n\\[Y=m(X)+\\varepsilon, \\qquad \\operatorname{E}(\\varepsilon\\mid X)=0,\\]\n\nwhere \\(m(X)=\\operatorname{E}(Y\\mid X)\\) is the conditional expectation of the response. The errors are homoscedastic if\n\n\\[\\operatorname{Var}(\\varepsilon\\mid X)=\\sigma^2\\]\n\nfor a finite constant \\(\\sigma^2\\), almost surely over the predictor distribution. Because \\(m(X)\\) is fixed once \\(X\\) is given, this is equivalent to\n\n\\[\\operatorname{Var}(Y\\mid X)=\\sigma^2.\\]\n\nThus, the spread around the conditional mean is constant even if the mean itself changes substantially with the predictors.\n\nFor grouped data, homogeneity of variance usually means\n\n\\[\\operatorname{Var}(Y\\mid G=g)=\\sigma^2\\]\n\nfor every group \\(g\\). This is the equal-variance assumption used in classical analysis of variance and the pooled two-sample \\(t\\)-test.\n\nEqual variances do not imply identical probability distributions. Groups can have different means, skewness, or tail behavior while sharing the same variance. Conversely, the concept requires that the relevant variance exist; it does not apply in the usual sense to distributions with undefined variance."
    },
    {
      "heading": "Conditional versus unconditional variance",
      "text": "In regression, the relevant assumption is generally conditional homoscedasticity, not merely equality of unconditional variances.\n\nFor example, suppose independent observations satisfy\n\n\\[X_i\\sim\\operatorname{Uniform}(0,1), \\qquad \\varepsilon_i\\mid X_i\\sim N(0,1+X_i).\\]\n\nEvery error has the same unconditional variance,\n\n\\[\\operatorname{Var}(\\varepsilon_i)=1+\\operatorname{E}(X_i)=\\frac32.\\]\n\nNevertheless, the model is heteroscedastic because\n\n\\[\\operatorname{Var}(\\varepsilon_i\\mid X_i)=1+X_i\\]\n\nincreases with the predictor. Equality of variance across observation indices is therefore not enough to establish constant conditional variance.\n\nThe conditioning information matters more generally. A process can have constant variance when averaged over time or across a population, yet exhibit changing variance conditional on past observations or subgroup membership."
    },
    {
      "heading": "Distinction from other assumptions",
      "text": "Homoscedasticity concerns only a second-moment property.\n\n- Normality: Homoscedastic errors need not follow a normal distribution. Normally distributed errors can also be heteroscedastic if their variances differ.\n- Independence: Constant variance does not imply statistical independence. Errors can have equal variances while remaining correlated.\n- Zero conditional mean: The condition \\(\\operatorname{E}(\\varepsilon\\mid X)=0\\) is separate. Constant variance does not prevent omitted-variable problems or endogeneity.\n- Correct mean specification: A model can have constant error variance but an incorrectly specified regression function.\n- Stationarity: In a time series, constant variance alone does not establish stationarity, which imposes additional restrictions on means, dependence, or full joint distributions.\n\nThese distinctions are important because procedures that address unequal variances do not automatically correct dependence or an incorrect mean model."
    },
    {
      "heading": "Role in linear regression",
      "text": "In linear regression, the sample model is written\n\n\\[y=X\\beta+\\varepsilon,\\]\n\nwhere \\(y\\) is an \\(n\\)-dimensional response vector, \\(X\\) is an \\(n\\times p\\) design matrix, and \\(\\beta\\) contains the regression coefficients.\n\nConditional homoscedasticity gives equal diagonal entries in the error covariance matrix. If the errors are also conditionally uncorrelated, then\n\n\\[\\operatorname{Var}(\\varepsilon\\mid X)=\\sigma^2 I_n.\\]\n\nThis matrix condition combines equal variances with zero off-diagonal covariances; equal variances alone do not imply it.\n\nIf \\(X\\) has full column rank, the ordinary least squares estimator is\n\n\\[\\hat\\beta=(X^\\mathsf{T}X)^{-1}X^\\mathsf{T}y.\\]\n\nUnder the spherical covariance condition above,\n\n\\[\\operatorname{Var}(\\hat\\beta\\mid X) = \\sigma^2(X^\\mathsf{T}X)^{-1}.\\]\n\nWith a correct conditional mean and \\(n>p\\), the usual unbiased estimator of the common error variance is\n\n\\[s^2=\\frac{e^\\mathsf{T}e}{n-p}, \\qquad e=y-X\\hat\\beta.\\]\n\nThe quantity \\(n-p\\) is the residual degrees of freedom. Substituting \\(s^2\\) for \\(\\sigma^2\\) yields the conventional coefficient standard errors.\n\nEfficiency and inference\n\nThe Gauss–Markov theorem states that, under the linear model, zero conditional mean, full column rank, and spherical error covariance, ordinary least squares has the smallest covariance matrix among linear unbiased estimators. Normality is not required for this result.\n\nIf errors are also conditionally jointly normal, conventional \\(t\\)- and \\(F\\)-statistics have their exact finite-sample reference distributions. Without normality, corresponding inference may still be approximately valid under suitable large-sample conditions.\n\nHeteroscedasticity alone does not make ordinary least squares biased. Under appropriate exogeneity and regularity conditions, it remains unbiased or consistent. What generally fails is the conventional covariance formula, and ordinary least squares need not retain its minimum-variance property. Consequently, conventional confidence intervals and tests can be miscalibrated."
    },
    {
      "heading": "Examples and scale dependence",
      "text": "An additive measurement model may reasonably use constant variance:\n\n\\[Y=a+bX+\\varepsilon, \\qquad \\varepsilon\\ \\text{independent of }X, \\qquad \\operatorname{Var}(\\varepsilon)=\\sigma^2.\\]\n\nThe response mean changes with \\(X\\), but the typical absolute measurement error does not.\n\nBy contrast, multiplicative variation often gives increasing spread on the original scale. Suppose\n\n\\[Y=\\exp(a+bX+U), \\qquad U\\mid X\\sim N(0,\\tau^2).\\]\n\nThen\n\n\\[\\log Y=a+bX+U\\]\n\nis homoscedastic on the logarithmic scale, whereas\n\n\\[\\operatorname{Var}(Y\\mid X) = \\bigl(\\exp(\\tau^2)-1\\bigr) \\exp(2a+2bX+\\tau^2)\\]\n\ngenerally depends on \\(X\\). Homoscedasticity is therefore a property of a specified model and measurement scale, not an intrinsic property of a dataset independent of its representation.\n\nSome response distributions naturally link variance to the mean. In a Poisson distribution, the variance equals the mean. In a Bernoulli distribution, it is \\(p(1-p)\\). Generalized linear models explicitly accommodate such mean–variance relationships rather than imposing constant response variance."
    },
    {
      "heading": "Assessment",
      "text": "Residual diagnostics\n\nPlots of residuals against fitted values or predictors are commonly used to examine whether the spread changes. A roughly uniform vertical spread is compatible with homoscedasticity; a funnel or fan pattern suggests heteroscedasticity.\n\nResiduals are not the same as unobserved errors. Even under a correctly specified homoscedastic linear model,\n\n\\[\\operatorname{Var}(e_i\\mid X)=\\sigma^2(1-h_{ii}),\\]\n\nwhere \\(h_{ii}\\) is the \\(i\\)-th diagonal entry of the projection matrix\n\n\\[H=X(X^\\mathsf{T}X)^{-1}X^\\mathsf{T}.\\]\n\nThus, raw residuals do not themselves have exactly equal variances when leverage differs. Standardized or studentized residuals account for this leverage dependence.\n\nApparent changes in residual spread can also reflect an incorrect mean function, unusual observations, or omitted groups. A residual plot does not uniquely identify the cause.\n\nFormal tests\n\nSeveral procedures test constant variance:\n\n- The Breusch–Pagan test examines whether squared residuals are related to specified predictors. Its original form uses a normality-based calibration; a studentized version relaxes that requirement.\n- The White test uses an auxiliary regression that can include predictors, their squares, and interactions, allowing a broader range of variance patterns.\n- Levene’s test assesses equality of variances across groups using absolute deviations from group centers. The median-centered Brown–Forsythe variant is less sensitive to nonnormality than the mean-centered version.\n\nThese are forms of statistical hypothesis testing, not proofs of equal variance. Failure to reject can reflect limited sample size or statistical power. Conversely, a very large sample may detect variance differences too small to materially affect a particular analysis. Test behavior can also depend on distributional assumptions and correct specification of the conditional mean."
    },
    {
      "heading": "Methods when variance is unequal",
      "text": "Different methods address different consequences of heteroscedasticity.\n\nHeteroscedasticity-consistent covariance estimation. For conditionally uncorrelated observations, the general ordinary least squares covariance is\n\n\\[\\operatorname{Var}(\\hat\\beta\\mid X) = (X^\\mathsf{T}X)^{-1} X^\\mathsf{T}\\Omega X (X^\\mathsf{T}X)^{-1},\\]\n\nwhere \\(\\Omega=\\operatorname{Var}(\\varepsilon\\mid X)\\). Heteroscedasticity-consistent standard errors estimate this covariance using squared residuals, with several finite-sample corrections. They leave the coefficient estimates unchanged and generally support asymptotic rather than exact finite-sample inference. Ordinary heteroscedasticity-consistent estimators do not by themselves address serial correlation or clustering.\n\nWeighted least squares. When conditional variances \\(\\sigma_i^2\\) are known, weighted least squares weights observations proportionally to \\(1/\\sigma_i^2\\). Under uncorrelated errors, this can improve efficiency. Estimated weights produce feasible weighted least squares, whose properties depend on the variance model and estimation procedure.\n\nTransformations and distributional modeling. Logarithms or other variance-stabilizing transformations may make constant variance more plausible, but they also change the modeled quantity and coefficient interpretation. Alternatively, a model can explicitly represent a mean-dependent variance.\n\nUnequal-variance group comparisons. Welch-type tests allow unequal group variances without pooling them into a common variance estimate.\n\nThe appropriate treatment depends on whether the objective is coefficient inference, efficient estimation, group comparison, or prediction. Robust coefficient standard errors do not estimate how the spread of individual future outcomes changes with the predictors; constructing conditional prediction intervals generally requires additional assumptions or a model for that spread."
    }
  ],
  "links": [
    "variance",
    "statistics",
    "conditional-expectation",
    "analysis-of-variance",
    "probability-distribution",
    "normal-distribution",
    "statistical-independence",
    "endogeneity",
    "time-series",
    "stationary-process",
    "linear-regression",
    "covariance-matrix",
    "ordinary-least-squares",
    "degrees-of-freedom",
    "standard-error",
    "gauss-markov-theorem",
    "confidence-interval",
    "poisson-distribution",
    "bernoulli-distribution",
    "generalized-linear-model",
    "statistical-hypothesis-testing",
    "statistical-power",
    "weighted-least-squares",
    "prediction-interval"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}