When will numpy.linalg.inv() and numpy.linalg.pinv() give very different values?
kind of figured it out. np.linalg.pinv, works by SVD decomposition and if A = USVt
then pinv(A) = V S^-1 Ut, and the shape of U and V are changed such that S^-1 is either mxm or nxn matrix. also, there is a cutoff for singular values, where less than cutoff are treated as zero. so if there are many small singular values, many rows/columns of V/U will be ignored and as such inv() and pinv() will give significantly different results.
for the equation Ax = b, let A = USV.t, i need to calculate inverse of (S.T@S). I noticecd that using np.linalg.inv() and np.linalg.pinv() gives extremely different results. np.allclose() infact returns false.
I want to know why this is happening, any mathematical insight? maybe due to some property of A? here A is a non-linear function of a dynamic time series.
Basically when can you expect pinv() and inv() to give very different results?