> "The metric that makes outliers pay dearly for their transgressions."
Mean Squared Error (MSE) measures the average of the squares of the errors between actual and predicted values. By squaring errors, MSE penalizes large deviations more heavily than small ones.
## Historical Context
MSE is fundamental to least-squares regression, dating back to Gauss and Legendre in the early 1800s. It remains the most widely used loss function in machine learning and statistical modeling due to its mathematical convenience and theoretical properties.
## Architecture & Physics
MSE squares each error before averaging, which has significant implications:
* Large errors contribute disproportionately to the metric
* The quadratic penalty creates a smooth, differentiable loss surface
* Optimal for normally distributed errors
### Properties
* **Non-negative**: MSE ≥ 0, with 0 indicating perfect prediction
* **Squared units**: If data is in dollars, MSE is in dollars²
* **Outlier sensitive**: Single large error dominates the metric
* **Differentiable**: Smooth gradient for optimization algorithms
## Mathematical Foundation
### 1. Squared Error
For each observation, calculate the squared difference: