📚 Lecture13-14_Gradient(RSS).pdf
Brief overview
This document introduces the concept of the Residual Sum of Squares (RSS) as a metric for evaluating model performance. Understanding RSS is crucial for gradient-based optimization methods used in statistical modeling.
Key points
- Calculating the residual sum of squares using its formula.
- Expressing RSS in vectorial form for computational efficiency.
- Methods for finding the RSS in a vectorial representation.
1. Calculating the residual sum of squares
1.1 The residual sum of squares formula
The residual sum of squares (RSS) measures the difference between observed values and predicted values. It quantifies the error in a model's predictions.
The formula for RSS, denoted as RSS(W), involves summing the squared differences between the actual values (yi) and the predicted values (<W, x_i>).
The RSS can be expressed in several equivalent forms. One form is: RSS(W)=∑i=1N(yi−⟨W,xi⟩)2.
This can be expanded to: RSS(W)=∑i=1N(yi2+⟨W,xi⟩2−2yi⟨W,xi⟩).
1.2 Vectorial form of RSS
In vectorial form, the RSS calculation becomes more compact. The design matrix X contains the feature vectors xi as rows.
The vector y contains the observed values. The vector W represents the model's weights.
The RSS can be written as: RSS(W)=∥y−XW∥2.
This is equivalent to: RSS(W)=(y−XW)T(y−XW).
1.3 Calculating the gradient of RSS
To minimize the RSS, we often compute its gradient with respect to the weights W. The gradient tells us the direction of the steepest increase in RSS.
The gradient of RSS(W) is given by: ∇WRSS(W)=−2XT(y−XW).
This formula shows how changes in the weights W affect the total error. Setting this gradient to zero helps find the optimal weights that minimize the RSS.
🔑 Important: Minimizing the RSS is a common objective in regression tasks, as it seeks to find the model that best fits the training data 1.