Square Root of Positive-Semidefinite Matrix, worried about bad eigenvalue

孤街醉人 提交于 2019-12-11 15:10:03

问题


I need to take the square root of a real symmetric 10,000 x 10,000 matrix. I thought of using scipy.linalg.sqrtm. I think the matrix is supposed to have 9,999 positive eigenvalues, and 1 zero eigenvalue. Just to be sure, I printed the eigenvalues; one of them came out around -1.05e-12. Probably just rounding error.

When I then calculated the matrix square root, I got entries with an imaginary part around e-10. Of course I could just chop those off and proceed with just the real parts (order of magnitude at least e-4). But are those trustworthy, or could the negative eigenvalue have ruined the accuracy of those?

Thanks

来源:https://stackoverflow.com/questions/57252639/square-root-of-positive-semidefinite-matrix-worried-about-bad-eigenvalue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!