Registered Member
|
Hi,
I'm using the Cholesky module (Eigen 2.0) for computing matrix square roots, and it sometimes happens that for apparently well-defined matrices, LLT will produce inaccurate results, with a few values diverging. It's a matter of fact that these matrices are never entirely symmetric, which is due to numerical issues, but for most of them LLT computes useful results nonetheless (though the documentation says it has to be symmetric). At least I can't figure out a difference between the stable and non-stable ones. Example: the matrix
will produce the result (denoted R) :
Note the bottom left corner, these values may be even smaller or also very high. Obviously, R * R.transpose() will not produce the original matrix. I originally found this to be a problem of elements in the zero blocks (I always use block matrices), and tried setting them to zero, but that will produce similar errors near the diagonal in the long term. I also tried using the LDLT, but it seems LDLT directly returns NaN values in these cases. I wonder, is this an error in the Cholesky module, or are my matrices somehow ill-conditioned? A symmetry issue indeed? Thank you in advance. |
Registered Member
|
Some important fixes just made it into the Cholesky module, including in the 2.0 branch. Can you check out the latest 2.0 branch (instructions on the main page of the wiki) and tell us if it works better for you?
EDIT: oops, you said LLt, the recent fixes were in LDLt. I'll have a look at your stuff.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
OK, now that I realized that you're using LLt, not LDLt, the reason for your trouble is clear: your matrix is almost singular, so LLt is going to be very unstable on it. There's no way around that. My best recommendation would be to try LDLt instead, and for that, update to the latest 2.0 branch.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Thanks, I'll try using the LDLt instead.
By "latest branch", do you mean the development branch or the 2.0.12 release? |
Registered Member
|
By "latest 2.0 branch" i mean the 2.0 branch, not the development branch. It's what's going to be released as 2.0.13 eventually.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]