Least-Squares Solution If is an matrix and , the vector is a least-squares solution of the linear system if for all .