Tutorials › Statistical Learning (Graduate) › Additive and Heteroscedastic Noise Models

Statistical Experiments and Targets · Tutorial 17 of 989

Additive and Heteroscedastic Noise Models

Write additive-noise models and derive how their conditional response laws and variances depend on the features.

Beginner 10 min read

What You'll Learn

  • Express a response as a signal plus an additive noise term.
  • Distinguish a conditional mean-zero error from an error independent of the features.
  • Derive the conditional response law when the error is independent of the features.
  • Identify homoscedastic and heteroscedastic models from their conditional variances.
  • Calculate conditional response distributions in normal and discrete examples.

Why Describe Noise Separately?

A regression model can describe a response as a systematic part that depends on the features, plus a remaining random part. This separation is useful because the systematic part and the noise answer different questions: the first describes how the response changes with the features, while the second describes how responses vary around that pattern. In particular, the noise model determines whether the conditional response distribution has the same spread at different feature values.

Write \(X\) for a feature and \(Y\) for a response. An additive-noise model has the form \(Y=m(X)+\varepsilon\), where \(m\) is a signal function and \(\varepsilon\) is a random error. The equation alone does not determine the conditional distribution of \(Y\) given \(X\): that also depends on how \(\varepsilon\) is distributed and how it relates to \(X\). We will make those assumptions explicit.

Definition: An additive-noise regression model represents the response as $$ Y=m(X)+\varepsilon, $$ where \(m\) is a real-valued function of the features and \(\varepsilon\) is a random error. The model is homoscedastic if \(\operatorname{Var}(Y\mid X)\) is a finite constant almost surely. It is heteroscedastic if this conditional variance is finite but is not almost surely constant.

Here “almost surely” means that a property can fail only for feature values having probability zero under the distribution of \(X\). Thus, a variance function may vary at feature values that never occur without making the model heteroscedastic in this definition. The function \(m\) is not automatically the conditional mean: that identification requires a condition on the error.

Conditional Mean and Variance in an Additive Model

Suppose \(E[\varepsilon\mid X]=0\) and \(E[\varepsilon^2\mid X]<\infty\) almost surely. Then \(m(X)\) is the conditional mean of \(Y\), and the conditional variance of \(Y\) is the conditional variance of the error.

Result: If \(Y=m(X)+\varepsilon\), \(E[\varepsilon\mid X]=0\), and \(\operatorname{Var}(\varepsilon\mid X)=v(X)<\infty\) almost surely, then $$ E[Y\mid X]=m(X) \qquad\text{and}\qquad \operatorname{Var}(Y\mid X)=v(X) $$ almost surely.

Proof. Conditional expectation is linear, and \(m(X)\) is determined by \(X\). Therefore $$ E[Y\mid X]=E[m(X)+\varepsilon\mid X] =m(X)+E[\varepsilon\mid X] =m(X). $$ For the variance, subtract this conditional mean from \(Y\): $$ Y-E[Y\mid X]=m(X)+\varepsilon-m(X)=\varepsilon. $$ Consequently, $$ \operatorname{Var}(Y\mid X) =E[(Y-E[Y\mid X])^2\mid X] =E[\varepsilon^2\mid X] =\operatorname{Var}(\varepsilon\mid X), $$ where the last equality uses \(E[\varepsilon\mid X]=0\). This gives the stated result. \(\square\)

This calculation shows why homoscedasticity is about conditional variance, not about whether the error is “small” or whether the signal is linear. A model may have a nonlinear \(m\) and constant conditional variance, or a linear \(m\) and feature-dependent conditional variance. The shape of \(m\) and the variance structure are separate modeling choices.

When the Error Is Independent of the Features

A stronger assumption is that \(\varepsilon\) is independent of \(X\). Independence says the full distribution of the error does not change with the features; conditional mean zero alone says only that its conditional average is zero. If the error is independent of \(X\), the conditional response distribution is a shifted copy of the error distribution.

Result: Suppose \(Y=m(X)+\varepsilon\), and \(\varepsilon\) is independent of \(X\) with distribution function \(F_{\varepsilon}\). Then, for almost every \(x\) under the distribution of \(X\), $$ P(Y\leq y\mid X=x)=F_{\varepsilon}(y-m(x)). $$ If \(\varepsilon\) has density \(f_{\varepsilon}\), the conditional density is \(f_{Y\mid X=x}(y)=f_{\varepsilon}(y-m(x))\).

Derivation. For a fixed \(x\), the event \(Y\leq y\), given \(X=x\), is the event \(m(x)+\varepsilon\leq y\), or equivalently \(\varepsilon\leq y-m(x)\). Independence means conditioning on \(X=x\) leaves the distribution of \(\varepsilon\) unchanged. Thus $$ P(Y\leq y\mid X=x) =P(\varepsilon\leq y-m(x)\mid X=x) =P(\varepsilon\leq y-m(x)) =F_{\varepsilon}(y-m(x)). $$ When a density exists, differentiating this translated distribution with respect to \(y\) gives the stated density. Conditional distributions given \(X=x\) are understood as a chosen regular conditional version; the formula is required only for almost every \(x\). \(\square\)

Independence is sufficient for this translation formula, but it is not required for the additive equation itself. If the error depends on the features, then its conditional distribution may change with \(x\), and the conditional response law must reflect that change. A useful special case makes the dependence explicit through a scale.

Scale model: Let \(Z\) be independent of \(X\), with \(E[Z]=0\) and \(\operatorname{Var}(Z)=1\). If $$ Y=m(X)+s(X)Z $$ for a positive scale function \(s\), then, for almost every \(x\), $$ P(Y\leq y\mid X=x)=F_Z\left(\frac{y-m(x)}{s(x)}\right), \qquad \operatorname{Var}(Y\mid X=x)=s(x)^2. $$

To see the variance formula, condition on \(X=x\). The signal \(m(x)\) and scale \(s(x)\) are then fixed, while \(Z\) retains its distribution by independence. Hence \(E[Y\mid X=x]=m(x)+s(x)E[Z]=m(x)\), and \(\operatorname{Var}(Y\mid X=x)=s(x)^2\operatorname{Var}(Z)=s(x)^2\). If \(s(x)\) varies on feature values of positive probability, this model is heteroscedastic.

Worked Examples

Worked Example: Constant-Variance Normal Noise

Suppose \(Y=1+2X+\varepsilon\), where \(\varepsilon\sim N(0,4)\) is independent of \(X\). Find the conditional distribution of \(Y\) given \(X=x\), and calculate \(P(0\leq Y\leq 4\mid X=0.5)\).

For a fixed \(x\), the signal is \(m(x)=1+2x\), and adding a constant to a normal variable shifts its mean without changing its variance. Therefore $$ Y\mid X=x\sim N(1+2x,4). $$ The second parameter here is the variance, so the conditional standard deviation is \(2\). At \(x=0.5\), the conditional mean is \(1+2(0.5)=2\), and \(Y\mid X=0.5\sim N(2,4)\). Standardizing the two endpoints gives $$ P(0\leq Y\leq 4\mid X=0.5) =P\left(\frac{0-2}{2}\leq Z\leq\frac{4-2}{2}\right) =P(-1\leq Z\leq1) =\Phi(1)-\Phi(-1)\approx0.6827, $$ where \(Z\sim N(0,1)\) and \(\Phi\) is its distribution function. The conditional variance is \(4\) at every feature value, so the model is homoscedastic.

Worked Example: A Feature-Dependent Normal Scale

Let \(X\) equal \(0\) with probability \(0.4\) and \(1\) with probability \(0.6\). Suppose $$ Y=2+X+\sqrt{1+3X}\,Z, $$ where \(Z\sim N(0,1)\) is independent of \(X\). Find the response distribution and variance at each possible feature value, and compute \(P(Y>3\mid X=x)\).

When \(X=0\), the mean is \(2\) and the scale is \(\sqrt{1}=1\). Thus \(Y\mid X=0\sim N(2,1)\), with variance \(1\), and $$ P(Y>3\mid X=0)=P(Z>1)\approx0.1587. $$ When \(X=1\), the mean is \(3\) and the scale is \(\sqrt{4}=2\). Thus \(Y\mid X=1\sim N(3,4)\), with variance \(4\), and $$ P(Y>3\mid X=1)=P(Z>0)=0.5. $$ The conditional variances differ at feature values that both have positive probability, so the model is heteroscedastic. The difference in these tail probabilities also illustrates that the conditional distributions do not have a common spread.

Worked Example: Discrete Additive Noise

Let \(X\) equal \(0\) or \(1\), each with positive probability, and suppose \(Y=3X+\varepsilon\). Independently of \(X\), let \(\varepsilon\) equal \(-1\), \(0\), or \(1\) with probabilities \(1/4\), \(1/2\), and \(1/4\), respectively. Find the conditional response distributions, means, and variances.

The error mean is $$ E[\varepsilon]=(-1)\left(\frac14\right)+0\left(\frac12\right)+1\left(\frac14\right)=0, $$ and its second moment is $$ E[\varepsilon^2]=1\left(\frac14\right)+0\left(\frac12\right)+1\left(\frac14\right)=\frac12. $$ Thus \(\operatorname{Var}(\varepsilon)=1/2\). When \(X=0\), \(Y=\varepsilon\), so \(Y\mid X=0\) takes values \(-1,0,1\) with probabilities \(1/4,1/2,1/4\). Its mean is \(0\) and its variance is \(1/2\). When \(X=1\), \(Y=3+\varepsilon\), so \(Y\mid X=1\) takes values \(2,3,4\) with those same probabilities. Its mean is \(3\), and its variance is $$ (2-3)^2\left(\frac14\right)+(3-3)^2\left(\frac12\right)+(4-3)^2\left(\frac14\right)=\frac12. $$ This is an additive, homoscedastic model, even though its conditional response distributions are discrete rather than normal.

What Homoscedasticity Does and Does Not Say

Homoscedasticity means that the conditional variance is constant, not that the conditional response distribution is identical at every feature value. In the discrete example, the distribution shifts with \(X\), while its variance stays the same. More generally, conditional distributions can differ in skewness or tail behavior even when their variances agree. Conversely, heteroscedasticity specifically records variation in conditional spread; it does not by itself say whether that spread increases or decreases with a feature.

A common mistake is to assume that writing \(Y=m(X)+\varepsilon\) automatically makes \(\varepsilon\) independent of \(X\), or automatically makes \(m(X)=E[Y\mid X]\). Neither conclusion follows from the equation. The correction is to state the required assumptions: \(E[\varepsilon\mid X]=0\) makes \(m(X)\) the conditional mean, while independence gives a feature-invariant error distribution and the shifted-law formula. A conditional mean-zero error can still have a distribution, including a variance, that changes with \(X\).

The distinction matters when specifying a model for prediction or inference. A constant-variance assumption can simplify calculations, but if the actual conditional spread changes with the features, it gives the wrong description of uncertainty for some feature values. A conditional response law, not just its mean function, describes the variation a learning procedure encounters.

Key takeaway: In an additive model, \(Y=m(X)+\varepsilon\), the assumptions on \(\varepsilon\) determine what \(m\) represents and how the response distribution changes with \(X\). Conditional variance constant in \(X\) is homoscedasticity; a genuinely feature-dependent conditional variance is heteroscedasticity.

Check Your Understanding

For each question, distinguish the additive representation from any additional distributional assumptions.

  1. If \(E[\varepsilon\mid X]=0\), what is \(E[Y\mid X]\) in the model \(Y=m(X)+\varepsilon\)?
  2. Suppose \(\varepsilon\) is independent of \(X\) and has distribution function \(F_{\varepsilon}\). Write the conditional distribution function of \(Y\) given \(X=x\).
  3. In the scale model \(Y=m(X)+s(X)Z\), where \(Z\) is independent of \(X\) and has variance \(1\), what is \(\operatorname{Var}(Y\mid X=x)\)?
  4. Can conditional response distributions change with \(X\) in a homoscedastic model? Explain using the discrete example.
  5. Why does the equation \(Y=m(X)+\varepsilon\), by itself, not imply that \(m(X)=E[Y\mid X]\)?
Clinical Biostats