Hat Matrix and Regression Leverage
Inspect how the hat matrix turns predictor geometry into leverage and leave-one-out predictions.
Free theory articleInspect how the hat matrix turns predictor geometry into leverage and leave-one-out predictions.
Concept & interpretation
The hat matrix is the matrix that maps the vector of observed values to the vector of fitted values.
Experiment
In the interactive Hat Matrix and Regression Leverage module, you can explore the effects of different design and response configurations on the leverage.
- Set the Design control to Single distinct (where x = [0, 0, 0, 1]). Notice how the last observation has a leverage of exactly 1.
- Set the Responses control to Last outlier and the Observation control to 3.
- Observe that for Single distinct, the LOO prediction is Unavailable because removing the observation at x=1 leaves the model unidentifiable at that point.
- Switch back to the Extreme design and observe the Leverage and LOO prediction values. High leverage points disproportionately affect the fitted regression line.