Currently I am using the EIGEN C++ library to try to solve $x$ from the equation $Ax$ = $b$. One problem I encountered is that the matrix $A$ is a correlation matrix with size  > 5000 and can sometimes be rank deficient and have small, even negative eigenvalues. As a result of that, the matrix tends to have huge condition numbers 100~1000+.Special properties of the matrix $A$ include: symmetric (because it is a correlation matrix) and the correlation decreases as the two entries get further away (e.g. $R_{1,2}$ > $R_{1,6}$). The current way I used to solve the equation is to use the truncated SVD method to obtain a pseudoinverse of $A$. I also tried to exploit the fact that the matrix is symmetric by using the self-adjoint eigen solver instead of SVD which speed up the process considerably. However, it still remains rather slow and from what I read, people always said one should NEVER EVER try to solve the inverse whenever possible. As a result of that, I wonder if there is anyway for one to speed up this process even further. I have read that one can use the QR method to obtain the pseudoinverse. My understanding is that for $A$ = $QR$, I can replace $R$ with $R_k$ the when the diagonal at $k$ is the last element bigger than a threshold and any subsequent row will be replaced by 0.So, my question is: is this QR method correct? Or is there any method that can better solve this kind of equation?
How can I efficiently solve $Ax$=$b$ given $A$ is symmetric and contains very small (even negative) eigenvalues using EIGEN
matrix;eigen;inverse problem