Generalized Inverse Matrices and their Statistical Applications