What is the hat matrix in Linear Regression and why is it important?

Updated May 16, 2026

Short answer

The hat matrix maps observed target values to predicted values and reveals influence of each data point.

Deep explanation

The hat matrix H = X(XᵀX)⁻¹Xᵀ transforms y into predictions: ŷ = Hy. Its diagonal elements (hᵢᵢ) measure leverage of each point. It is fundamental in diagnostics because it quantifies how much each observation affects its own prediction.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Linear Regression interview questions

View all →