SVD, pseudoinverse, and PCA: SVD: singular value decomposition
Pseudoinverse and the least squares method
Let be an matrix, be a vector in , and suppose you want to solve the equation . If the image of is the entire space, then the equation has a solution, namely . But what if is not in the image of ? Then we can determine a vector in the image of , with shortest distance to : for all . What we try to find is the orthogonal projection of on the image of , in other words, we search for a vector such that Such a vector is called a least squares approximation of . We know that is perpendicular to the image of and thus is an element of the kernel . So: , but this is equivalent to If is invertible, then the least squares approximation is unique and given by
Let be an matrix with , then is invertible. The pseudoinverse of , also known Moore-Penrose inverse, is the matrix defined by
Note that the pseudoinverse of an matrix is an matrix.
Application of the pseudoinverse of a matrix on a vector provides the least squares approximation of the vector. The relationship between the pseudoinverse and singular value decomposition is as follows and generalizes the definition of a pseudoinverse to an arbitrary matrix.
General definition of pseudoinverse Let be an matrix with singular value decomposition , wherein is an matrix with the diagonal submatrix with nonzero singular values of on the main diagonal, i.e., . Then the pseudoinverse of is the matrix defined by wherein is the matrix
The following theorem holds:
The least squares problem has a unique least squares approximation that is closest to the origin, namely
As an example, we consider an earlier regression problem: a regression line for points , and . In the regression model we have the associated matrix We can compute the pseudoinverse of : with determinant . So the inverse of this matrix is The pseudoinverse is: To determine the regression line, we must compute the following matrix-vector product in order to determine the coefficients of the equation describing the regression line: So we have found the equation for the regression line.