Fastest way to solve least square for overdetermined system

Viewed 2848

I have a matrix A of size m*n( m order of ~100K and n ~500) and a vector b. Also, my matrix is ill-conditioned and rank-deficient. Now I want to find out the least-square solution to Ax = b and to this end I have compared some of the methods:

  • scipy.linalg.lstsq (time/residual) : 14s, 626.982
  • scipy.sparse.linalg.lsmr (time/residual) : 4.5s, 626.982 (same accuracy)

Now I have observed that when I don't have the rank-deficient case forming the normal equation and solving it using cholesky factorization is fastest way to solve my problem. So my question is this If I am not interested in the minimum norm solution then is there a way to get a solution(any) to (A^TAx=b) when A^TA is singular. I have tried scipy.linalg.solve but it gives LinAlgError for singular matrices. Also I would like to know if A is such that m>>n, ill-conditonied, possibly not full col-rank then which method should one use in terms of time, residual accuracy(or any other metric). Any thoughts and help is greatly appreciated. Thanks!

1 Answers
Related