The hat matrix ($H$) is important for theoretical calculations of least squares. $H = X(X^TX)^{-1} X^T$