comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL inverse matrix problem??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL inverse matrix problem?? [message #90082 is a reply to message #90078] Fri, 23 January 2015 11:50 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Friday, January 23, 2015 at 1:32:44 PM UTC-5, Amin Farhang wrote:
> Dear Chris,
>
> I wonder that why IDL could not handle this, therefore check the inversion with matlab and Python but both of them return correct values. I think it is necessary that IDL developers consider this kind of issues, since I'm seeing that the Astronomer's community are slowly shift to Python or other languages.


A few more notes. The condition number of your example matrix (first element -6.8599934d+16) is about kappa = 3e9.

Let's check Wikipedia for Condition Number, "As a general rule of thumb, if the condition number kappa = 10^k, then you may lose up to k digits of accuracy on top of what would be lost to the numerical method due to loss of precision from arithmetic methods." (more caveats to be read in that article, it's a rule of thumb, not a firm equation)

In our case k = 9. In your matrix you were seeing ~1e-8 errors and double precision is capable of precision 2e-16, which implies a loss of precision of (1e-8/2e-16) ~ 8 digits. That's pretty close to the k=9 predicted by the rule of thumb. The rule of thumb seems plausible. I'm not sure how you will do much better with Python or Matlab, unless they have a quad-precision mode.

Also, I stand by my previous statement... If numerical precision is important to you, you probably should not be directly inverting the matrix. Keep on poking yourself in the eye if you want though. If you are trying to solve normal equations in a least squares problem, best to factor the matrix with a stable factorization algorithm. Or even better, skip the normal equations altogether and factor the Jacobian directly.

CM
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HASH assignment
Next Topic: saving an output from the find.pro script

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:47:09 PDT 2025

Total time taken to generate the page: 0.00468 seconds