Tuesday, August 27, 2024

Breaking Down RSS, TSS, and ESS for Better Regression Understanding

Understanding TSS, RSS, ESS and R²

Understanding RSS, TSS, ESS & R² in Regression

In regression analysis, we measure how well a model explains variation in data using three core quantities: Total Sum of Squares (TSS), Residual Sum of Squares (RSS), and Explained Sum of Squares (ESS).


๐ŸŽฏ Learning Goal

Understand how total variation in data is decomposed into explained and unexplained parts.

๐Ÿ’ก Core Identity: TSS = ESS + RSS

๐Ÿ“˜ Key Definitions

1️⃣ Total Sum of Squares (TSS)

Definition: Measures total variation in y around its mean.

TSS = ฮฃ (y_i - y_mean)^2
  • y_i → actual values
  • y_mean → mean of y
๐Ÿ’ก TSS represents total variability before modeling.

2️⃣ Residual Sum of Squares (RSS)

Definition: Measures unexplained variation (model error).

RSS = ฮฃ (y_i - y_hat_i)^2
  • y_hat_i → predicted values
๐Ÿ’ก RSS measures how wrong the model is.

3️⃣ Explained Sum of Squares (ESS)

Definition: Measures variation explained by the model.

ESS = ฮฃ (y_hat_i - y_mean)^2
๐Ÿ’ก ESS measures how much the model explains.

๐Ÿ”— The Fundamental Relationship

TSS = ESS + RSS

The total variability in y is split into:

  • Explained part (ESS)
  • Unexplained part (RSS)
๐Ÿ’ก Regression decomposes total variation into explained and residual components.

๐Ÿ“Š Visual Interpretation (Conceptual)

Think of It Geometrically

TSS → Distance from actual points to the mean ESS → Distance from predictions to the mean RSS → Distance from actual points to predictions

Graphically:

  • Mean line → baseline model
  • Regression line → improved model
  • Vertical gaps → residuals


๐Ÿ“ˆ Coefficient of Determination (R²)

R^2 = ESS / TSS
R^2 = 1 - (RSS / TSS)

Interpretation

  • R² = 1 → Perfect fit
  • R² = 0 → No improvement over mean
๐Ÿ’ก R² measures the proportion of total variance explained by the model.

๐Ÿงช Step-by-Step Example Logic

How You Compute in Practice
  1. Compute y_mean
  2. Calculate TSS using actual values
  3. Fit regression → obtain y_hat
  4. Calculate RSS
  5. Compute ESS = TSS − RSS
  6. Compute R²

๐Ÿ“Œ Final Summary

  • TSS → Total variability
  • ESS → Explained variability
  • RSS → Unexplained variability
๐Ÿ’ก A good regression model minimizes RSS and maximizes ESS.

End of Interactive Learning Guide

No comments:

Post a Comment

Featured Post

How HMT Watches Lost the Time: A Deep Dive into Disruptive Innovation Blindness in Indian Manufacturing

The Rise and Fall of HMT Watches: A Story of Brand Dominance and Disruptive Innovation Blindness The Rise and Fal...

Popular Posts