Variance Components in $R^2$ (Coefficient of Determination)

Version 20 | Created: 2026-04-08 | Updated: 2026-11-07 13:46 UTC
- 1. Executive Summary
- 2. Mathematical Definition Of $R^2$
- 3. The Impact Of Increased Error Variance
- 4. The Impact Of Increased Predictor Variance
- 5. Summary Of Variance Effects On $R^2$
- 6. Practical Implications For Machine Learning Models
- 7. Conclusion
- 8. Variation With Sample Distributions Along The 1-To-1 Line
- Appendix A. Terminology
A note on why
$R^2$ moves with the variance of the residuals and with the variance of the predictor, and on reading it as a ratio rather than as an absolute measure of accuracy.
The coefficient of determination, denoted as
To understand why variance dictates the behavior of
- Explained variation
SS_regis the variation accounted for by the relationship between$X$ and$Y$ . - Unexplained variation
SS_resis the variation resulting from the residuals, that is the noise$\epsilon$ .
The fundamental identity is
Definition:
$R^2$
$R^2$ is the proportion of the total variance in$Y$ that is explained by$X$ .
The two sums of squares are the residual sum of squares and the total sum of squares.
The first scenario involves an increase in the variance of the residuals
(
As the noise in the data increases, each observed value SS_res term. In equation (2), as the
numerator of that fraction increases, the whole fraction SS_res / SS_tot grows larger.
Consequently, when this larger value is subtracted from 1, the resulting
In the context of information theory and machine learning, the relationship between
Increased noise or residual variance diminishes the explanatory power of the model, leading to a lower
$R^2$ .
This illustrates that a low
A more counterintuitive phenomenon occurs when the variance of the independent variable
In a simple linear regression, the explained variance is expressed as
When the variance of
In the fraction
When
A wider range or higher variance in the independent variable often inflates the
$R^2$ , as the model captures a larger portion of the overall trend.
The following table summarizes the relationship between the variance components and the resulting coefficient of determination.
Table 1. Variance components and their effect on
| Scenario | Effect on |
Statistical reason |
|---|---|---|
| Higher residual variance ( |
Decreases | The unexplained portion |
| Higher predictor variance ( |
Increases | The explained portion |
| Lower total variance ( |
Decreases | When the total spread of |
In machine learning, relying solely on
- Model comparison is not straightforward. The
$R^2$ of a model trained on a narrow dataset cannot easily be compared with one trained on a diverse, wide-ranging dataset, because the latter will likely have a higher$R^2$ simply due to the variance in$X$ . - High variance in
$X$ sometimes masks poor model performance in specific sub-regions of the data, which is a route to overfitting that the single number does not reveal. - Feature selection is essentially an attempt to increase the explained variance
$SS_{reg}$ so that the relative weight of the residuals falls.
The reason changes in variance affect
Understanding this dynamic prevents the common pitfall of dismissing a model with a low
The chart below sweeps the sigma score, that is the coefficient of variation std / mean, over
the range 0.1 to 4.0 for samples placed along the 1-to-1 line, and records the
Fig 1.
The figure is produced by sigma_r2.py, in the folder of this document.
-
Coefficient of determination: 결정계수
$R^2$ . The proportion of variance in the dependent variable that is predictable from the independent variable. - Explanatory power: 설명력. The capacity of a model to represent the underlying patterns in the data.
- Mean absolute error: 평균 절대 오차. The mean of the absolute differences between observed and predicted values, carrying the unit of the observations.
- Mean squared error: 평균 제곱 오차. The mean of the squared differences between observed and predicted values.
- Residual variance: 잔차 분산. The variance of the differences between observed and predicted values.
Version 12 | Created: 2026-09-04 | Updated: 2026-11-07 13:46 UTC
- 1. Executive Summary
- 2. Mathematical Definition Of $R^2$
- 3. The Impact Of Increased Error Variance
- 4. The Impact Of Increased Predictor Variance
- 5. Summary Of Variance Effects On $R^2$
- 6. Practical Implications For Machine Learning Models
- 7. Conclusion
- 8. Variation With Sample Distributions Along The 1-To-1 Line
- Appendix A. Terminology
$R^2$ 가 잔차의 분산과 예측변수의 분산을 따라 움직이는 이유, 그리고 그것을 정확도의 절대 척도가 아니라 비율로 읽는 법에 대한 기록.
Coefficient of determination
분산이 왜
- 설명된 변동
SS_reg는$X$ 와$Y$ 의 관계가 감당하는 변동이다. - 설명되지 않은 변동
SS_res는 잔차, 곧 잡음$\epsilon$ 에서 오는 변동이다.
기본이 되는 항등식은 아래이다.
Definition:
$R^2$
$R^2$ 는$Y$ 의 총분산 가운데$X$ 가 설명하는 비율이다.
두 제곱합은 잔차제곱합과 총제곱합이다.
첫 번째 경우는 참인 관계
자료의 잡음이 커지면 각 관측값 SS_res 항을
곧바로 부풀린다. 식 (2) 에서 그 분수의 분자가 커지면 분수 SS_res / SS_tot 전체가 커진다. 그 커진
값을 1 에서 빼므로 결과인
정보이론과 machine learning 의 맥락에서
잡음 또는 잔차 분산이 커지면 model 의 explanatory power 가 줄고
$R^2$ 가 낮아진다.
이것은
독립변수
단순 선형회귀에서 설명된 분산은 아래처럼 적힌다.
분수
독립변수의 범위가 넓거나 분산이 크면 model 이 전체 추세의 더 큰 몫을 붙잡게 되어
$R^2$ 가 흔히 부풀려진다.
아래 표는 분산 성분과 그로부터 나오는 coefficient of determination 의 관계를 정리한 것이다.
Table 1. Variance components and their effect on
| Scenario | Effect on |
Statistical reason |
|---|---|---|
| Higher residual variance ( |
Decreases | 자료에서 설명되지 않는 몫 |
| Higher predictor variance ( |
Increases | 설명되는 몫 |
| Lower total variance ( |
Decreases |
|
Machine learning 에서
- Model 비교가 간단하지 않다. 좁은 자료에서 학습한 model 의
$R^2$ 는 다양하고 넓은 자료에서 학습한 model 의 것과 곧바로 견주기 어렵다. 뒤의 것은 오로지$X$ 의 분산 때문에$R^2$ 가 높을 가능성이 크기 때문이다. -
$X$ 의 분산이 크면 자료의 특정 구간에서의 나쁜 성능이 가려지기도 하며, 이는 수 하나로는 드러나지 않는 overfitting 의 통로이다. - Feature selection 은 본질적으로 설명된 분산
$SS_{reg}$ 를 키워 잔차의 상대적 비중을 떨어뜨리려는 시도이다.
분산의 변화가
이 역학을 이해하면 잡음이 큰 환경에서
아래 chart 는 1 대 1 선 위에 놓인 표본에 대해 sigma score, 곧 변동계수 std / mean 을 0.1 에서
4.0 까지 훑으며 각 표본이 내는
Fig 1.
그림은 이 문서와 같은 folder 에 있는 sigma_r2.py 가 만든다.
-
Coefficient of determination: 결정계수
$R^2$ . 독립변수로부터 예측되는 종속변수 분산의 비율. - Explanatory power: 설명력. 자료에 깔린 pattern 을 model 이 나타낼 수 있는 정도.
- Mean absolute error: 평균 절대 오차. 관측값과 예측값의 절대 차이의 평균이며, 관측값의 단위를 가진다.
- Mean squared error: 평균 제곱 오차. 관측값과 예측값의 차이를 제곱한 것의 평균.
- Residual variance: 잔차 분산. 관측값과 예측값의 차이가 가지는 분산.

