The Linear least square solution is obtained by solving $XB =y$ and then $B$ is calculated by following equation
$$B =(X^TX)^{-1}Xy $$
Why we go for a pseudo inverse instead of taking a inverse
$$B = X^{-1}y$$
The Linear least square solution is obtained by solving $XB =y$ and then $B$ is calculated by following equation
$$B =(X^TX)^{-1}Xy $$
Why we go for a pseudo inverse instead of taking a inverse
$$B = X^{-1}y$$
In least squares problems we are dealing with an overdetermined system. This means that we have more equations than unknowns, thus the matrix $X$ in your problem is not square. The inverse of a matrix is not defined for non-square matrices. One way of getting around this is to take the inverse of the square matrix product $X^TX$ and form the pseudo-inverse $(X^TX)^{-1}X^T$.
If the matrix has full column rank, then the pseudoinverse is the same as the classic inverse. Details are provided in What forms does the Moore-Penrose inverse take under systems with full rank, full column rank, and full row rank? or generalized inverse of a matrix and convergence for singular matrix.
If the matrix has a column rank defect, then the classic inverse does not exist.
In summary, the answer is always expressed in terms of the pseudoinverse. When the classic inverse exists, it is the same as the pseudoinverse.