Tutorials › Statistical Learning (Graduate) › Series Risk Under Heteroskedastic Noise

Series and Wavelet Estimation · Tutorial 449 of 989

Series Risk Under Heteroskedastic Noise

Calculate heteroskedastic series risk and determine when design-dependent noise changes which basis terms are worth retaining.

Advanced 12 min read

What You'll Learn

  • Define the variance-profile matrix for a finite series regression.
  • Derive exact coefficient covariance and integrated prediction risk for a fixed design.
  • Interpret the corresponding large-sample risk under random design.
  • Compare basis terms’ variance contributions under heteroskedastic noise.
  • Use the risk increment to assess whether another series term should be retained.

Why the Noise Profile Matters

A series estimator approximates a regression function with a finite collection of basis functions. Its prediction risk reflects both the error from truncating that approximation and the variability of the estimated coefficients. When the regression errors have constant variance, the noise contribution is relatively uniform across the design. When their variance depends on the design point, some parts of the domain can contribute more uncertainty than others. A basis term concentrated in a high-variance region can therefore cost more than one with the same scale concentrated in a low-variance region.

The key calculation is not just the variance of each coefficient separately. In a general basis, coefficient errors can be correlated, and integrated prediction risk combines their covariance using the geometry of the basis. The formulas below make both features explicit and give a direct way to compare truncation choices.

Setup and Definitions

Let \(x_1,\ldots,x_n\) be fixed design points, and let \(p_K(x)=(\phi_1(x),\ldots,\phi_K(x))^\top\) be a vector of \(K\) basis functions. Write \(P\) for the \(n\times K\) matrix whose \(i\)th row is \(p_K(x_i)^\top\). Suppose \(P\) has full column rank and \(Y_i=m(x_i)+\varepsilon_i\), where the errors are independent, \(E[\varepsilon_i\mid x_1,\ldots,x_n]=0\), and \(\operatorname{Var}(\varepsilon_i\mid x_1,\ldots,x_n)=\sigma^2(x_i)\).

Definition: The series least-squares estimator is \(\hat\beta_K=(P^\top P)^{-1}P^\top Y\), and its fitted function is \(\hat m_K(x)=p_K(x)^\top\hat\beta_K\). Define the empirical Gram matrix \(Q_n=P^\top P/n\), the heteroskedastic variance matrix \(\Omega_n=n^{-1}\sum_{i=1}^n\sigma^2(x_i)p_K(x_i)p_K(x_i)^\top\), and the empirical projection coefficient \(\beta_{K,n}=(P^\top P)^{-1}P^\top m_n\), where \(m_n=(m(x_1),\ldots,m(x_n))^\top\).

The coefficient \(\beta_{K,n}\) is the least-squares projection of the vector of true regression values onto the columns of \(P\). It need not make the approximation error zero. The prediction risk on the observed design is \(R_n=E[n^{-1}\sum_{i=1}^n\{\hat m_K(x_i)-m(x_i)\}^2\mid x_1,\ldots,x_n]\). This risk measures average squared prediction error at the design points; it is not an average over a different target distribution.

Exact Coefficient Variance and Fixed-Design Risk

Theorem: Under the fixed-design assumptions above, \(\operatorname{Cov}(\hat\beta_K\mid x_1,\ldots,x_n)=n^{-1}Q_n^{-1}\Omega_n Q_n^{-1}\). Moreover, \(R_n=n^{-1}\sum_{i=1}^n\{m(x_i)-p_K(x_i)^\top\beta_{K,n}\}^2+n^{-1}\operatorname{tr}(Q_n^{-1}\Omega_n)\).

To prove the covariance formula, write \(Y=m_n+\varepsilon\). Since \(E[\varepsilon\mid x_1,\ldots,x_n]=0\), the random part of \(\hat\beta_K\) is \((P^\top P)^{-1}P^\top\varepsilon\). The conditional covariance of \(\varepsilon\) is the diagonal matrix \(D=\operatorname{diag}(\sigma^2(x_1),\ldots,\sigma^2(x_n))\). Independence gives this diagonal covariance, so

$$ \begin{aligned} \operatorname{Cov}(\hat\beta_K\mid x_1,\ldots,x_n) &=(P^\top P)^{-1}P^\top D P(P^\top P)^{-1}\\ &=(nQ_n)^{-1}(n\Omega_n)(nQ_n)^{-1}\\ &=n^{-1}Q_n^{-1}\Omega_n Q_n^{-1}. \end{aligned} $$

For the risk identity, decompose the fitted error into its deterministic approximation part and its centered estimation error: \(\hat m_K(x_i)-m(x_i)=p_K(x_i)^\top(\hat\beta_K-\beta_{K,n})+\{p_K(x_i)^\top\beta_{K,n}-m(x_i)\}\). The empirical projection residual vector is orthogonal to every column of \(P\), because \(P^\top(m_n-P\beta_{K,n})=0\). Consequently the cross term in the average squared error is zero for every coefficient perturbation. Taking conditional expectations leaves the squared projection residual plus \(E[(\hat\beta_K-\beta_{K,n})^\top Q_n(\hat\beta_K-\beta_{K,n})\mid x_1,\ldots,x_n]\). For a centered random vector \(Z\) and fixed matrix \(A\), \(E[Z^\top A Z]=\operatorname{tr}(A\operatorname{Cov}(Z))\). Applying this identity and the covariance formula yields \(\operatorname{tr}(Q_n n^{-1}Q_n^{-1}\Omega_n Q_n^{-1})=n^{-1}\operatorname{tr}(Q_n^{-1}\Omega_n)\). This proves both claims. \(\square\)

The first term is the empirical truncation error. The second is the integrated coefficient-variance contribution, measured in the prediction geometry \(Q_n\). The variance matrix \(\Omega_n\) contains the design-dependent noise levels. If the errors are homoskedastic with variance \(\sigma^2\), then \(\Omega_n=\sigma^2Q_n\), and the variance contribution reduces to \(\sigma^2K/n\). That simplification generally does not hold under heteroskedasticity.

Worked Example: Intercept and Slope at Two Design Points

Suppose there are \(n/2\) observations at each of \(x=-1\) and \(x=1\), with even \(n\). Use \(p_2(x)=(1,x)^\top\), and let the error variances be \(\sigma^2(-1)=1\) and \(\sigma^2(1)=9\). Calculate the coefficient covariance and integrated variance contribution.

The two basis vectors are \(p_2(-1)=(1,-1)^\top\) and \(p_2(1)=(1,1)^\top\). Their equal design frequencies give \(Q_n=\tfrac12[p_2(-1)p_2(-1)^\top+p_2(1)p_2(1)^\top]=I_2\). The variance matrix is

$$ \begin{aligned} \Omega_n &=\tfrac12\left[ 1\begin{pmatrix}1&-1\\-1&1\end{pmatrix} +9\begin{pmatrix}1&1\\1&1\end{pmatrix} \right]\\ &=\begin{pmatrix}5&4\\4&5\end{pmatrix}. \end{aligned} $$

Because \(Q_n=I_2\), the coefficient covariance is \(\Omega_n/n\). Thus the intercept and slope variances are both \(5/n\), and their covariance is \(4/n\). The integrated variance contribution is \(n^{-1}\operatorname{tr}(\Omega_n)=10/n\).

The positive covariance has a specific source: the high-variance point \(x=1\) has basis vector \((1,1)^\top\), so its intercept and slope score components have the same sign. Its positive off-diagonal contribution outweighs the opposite-sign contribution from \(x=-1\), whose variance is only 1. Reversing that explanation would give the wrong sign intuition.

Random-Design Interpretation

For random design, let \(X\) have distribution \(F\), assume \(E[\varepsilon\mid X]=0\) and \(\operatorname{Var}(\varepsilon\mid X)=\sigma^2(X)\), and define \(Q_K=E[p_K(X)p_K(X)^\top]\) and \(\Omega_K=E[\sigma^2(X)p_K(X)p_K(X)^\top]\). Suppose \(K\) is fixed, \(Q_K\) is positive definite, the required second moments are finite, and the observations are independent and identically distributed. In a correctly specified \(K\)-term model, the usual least-squares sandwich covariance has leading term \(n^{-1}Q_K^{-1}\Omega_KQ_K^{-1}\). Its integrated prediction-variance contribution, measured under the same design distribution \(F\), is therefore \(n^{-1}\operatorname{tr}(Q_K^{-1}\Omega_K)\).

This expression also describes the noise component of the leading risk calculation when considering a series approximation. In that case, random variation in the approximation residual can add to the sandwich “meat”: for the population projection residual \(r_K(X)=m(X)-p_K(X)^\top\beta_K\), the relevant matrix is \(E[(\sigma^2(X)+r_K(X)^2)p_K(X)p_K(X)^\top]\). The extra term records that the response differs from its projection not only through measurement noise but also through the residual left by truncation. Thus a noise-only variance calculation should not be mistaken for the complete random-design covariance under misspecification.

Worked Example: Different Terms Have Different Noise Costs

Let \(X\) be uniform on \([-1,1]\), and use \(\phi_0(x)=1\) and \(\phi_1(x)=\sqrt{3}x\). These functions are orthonormal under the uniform design: \(E[\phi_0^2]=E[\phi_1^2]=1\) and \(E[\phi_0\phi_1]=0\). Let \(\sigma^2(x)=1+3x^2\), which is positive throughout the domain.

The variance contribution of the constant term is \(E[\sigma^2(X)\phi_0(X)^2]=1+3E[X^2]=1+3/3=2\). For the second term it is \(E[\sigma^2(X)\phi_1(X)^2]=E[(1+3X^2)3X^2]=3E[X^2]+9E[X^4]=1+9/5=14/5\). Here \(E[X^2]=1/3\) and \(E[X^4]=1/5\). The integrated variance for both terms is therefore \((2+14/5)/n=24/(5n)\).

If the noise instead had constant variance equal to the average of \(1+3X^2\), namely 2, both orthonormal terms would contribute \(2/n\), for total variance \(4/n\). The actual heteroskedastic profile raises the second term’s contribution from \(2/n\) to \(14/(5n)\). The comparison is term-specific: knowing only the average error variance does not determine each basis coefficient’s variance cost.

How Heteroskedasticity Changes Truncation

For a nested, orthonormal series under the target design distribution, write the population regression function’s coefficients as \(\beta_j\). At a fixed design, the analogous statements hold for an empirically orthonormal basis. Define \(v_j=E[\sigma^2(X)\phi_j(X)^2]\), the noise contribution for term \(j\). The projection bias from truncating after \(K\) terms is \(\sum_{j>K}\beta_j^2\), and the noise contribution is \(n^{-1}\sum_{j\le K}v_j\). These expressions give a simple risk comparison.

Theorem: For the orthonormal-basis risk \(R(K)=\sum_{j>K}\beta_j^2+n^{-1}\sum_{j\le K}v_j\), adding term \(K+1\) changes risk by \(R(K+1)-R(K)=-\beta_{K+1}^2+v_{K+1}/n\). Thus adding the term lowers this risk exactly when \(\beta_{K+1}^2>v_{K+1}/n\).

To verify the formula, subtract the two risks. The bias sum for \(K+1\) omits one additional term, so it changes by \(-\beta_{K+1}^2\). The variance sum includes one additional contribution, changing by \(v_{K+1}/n\). Adding these changes gives the stated difference; it is negative precisely when the coefficient’s squared signal exceeds its variance cost. \(\square\)

This calculation explains what “heteroskedasticity changes optimal truncation” means. It changes the \(v_j\), and so it can change whether the next term reduces risk. In a nonorthogonal basis, individual terms need not have this separate risk-increment interpretation: the full expression \(n^{-1}\operatorname{tr}(Q_K^{-1}\Omega_K)\) accounts for the geometry and covariance jointly.

Worked Example: A Term Worth Keeping Under Constant Noise but Not Here

Continue with the uniform design and basis from the previous example. Consider two candidate models: the constant-only model and the model that also includes \(\phi_1(x)=\sqrt{3}x\). Suppose the true coefficient of \(\phi_1\) has square \(\beta_1^2=0.024\), the sample size is \(n=100\), and the constant term is included in both models.

Under the heteroskedastic profile \(\sigma^2(x)=1+3x^2\), the additional term’s variance cost is \(v_1/n=(14/5)/100=0.028\). Its reduction in squared approximation error is \(0.024\). The risk change is therefore \(-0.024+0.028=0.004\), so adding the term increases this risk. The constant-only model has risk contribution \(0.024+2/100=0.044\), while the two-term model has variance contribution \((2+14/5)/100=0.048\); hence the constant-only model has lower risk.

Under homoskedastic noise with variance 2, the additional term would cost \(2/100=0.020\). The risk change would then be \(-0.024+0.020=-0.004\), so adding the term would reduce risk. The contrast is not due to a change in the signal coefficient or sample size; it follows from the additional basis term’s higher noise contribution under the given variance profile.

Common Pitfall and Practical Use

A common mistake is to replace every \(\sigma^2(x_i)\) by the average noise variance and then use the homoskedastic formula \(\sigma^2K/n\). That shortcut is valid when the basis geometry makes the variance matrix proportional to the Gram matrix, as under constant variance. Under heteroskedasticity, the correct term is \(n^{-1}\operatorname{tr}(Q_n^{-1}\Omega_n)\). Even when the average variance is known, the placement of high-variance observations relative to the basis functions matters.

Another pitfall is to report only the diagonal coefficient variances when the goal is integrated prediction risk. Correlations between coefficient estimates may matter through the matrix expression, especially when the basis is not orthogonal in the target prediction metric. For an orthonormal basis, the risk trace simplifies to the sum of termwise variance costs, but the coefficients can still be correlated.

In practice, the risk decomposition helps separate two decisions: how well a series basis approximates the regression function, and how much noise is paid to estimate its coefficients. Under heteroskedasticity, a term with a modest approximation benefit may be unattractive if it places substantial weight where errors are especially variable. Truncation should therefore reflect both the signal coefficients and the design-weighted variance profile, not just the nominal number of basis functions.

Check Your Understanding

Use the definitions and risk formulas to answer the following questions.

  1. For fixed design, explain why the coefficient covariance contains \(Q_n^{-1}\) on both sides of \(\Omega_n\).
  2. When does \(n^{-1}\operatorname{tr}(Q_n^{-1}\Omega_n)\) reduce to \(\sigma^2K/n\)?
  3. In the two-point example, why is the intercept–slope covariance positive even though the \(x=-1\) basis vector contributes a negative off-diagonal term?
  4. For an orthonormal basis, what inequality determines whether adding the next term lowers the stated risk?
  5. Why can the average error variance alone be insufficient to determine a basis term’s variance cost?
Clinical Biostats