|Re: [eigen] Machine precision<> too coarse|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Machine precision<> too coarse
- From: Keir Mierle <mierle@xxxxxxxxx>
- Date: Tue, 3 Feb 2009 09:50:18 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=n9X/PpHFfOYrFoTxYAAEhDtkKAZHl5/P9eQ1oiLEr0Q=; b=m579lJd08BZetyLsugpLNCTIALeVcbKNaa9vFWnR0i2AjwsSuN+vlpdx7MnsvFAZE9 T5Jra21YsEEY/MJMacvxfTyDdSwUK1Btt6Vb5cXpwUxQtRCM+behOmmKxD7wcSye34Mg 3/2HorKThb0PFQrBZrowqryRoIBppIoM9coT0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=oCvFNKMSA3yQLCX0FbAPv4wVBD5NpAoVGnEBTr18xw/hfgGTZOEdaEPmq2T2RLuygj 1pzdheoPwr+eqZUoe8R9bDH818weBNsPJRcFGTdtjaC99CKL737c9as1E74xIjbYSnsK QGKrWeTw/hho545y7ebxSB7K1v/YA7uhb/f9o=
On Tue, Feb 3, 2009 at 8:59 AM, Benoit Jacob <jacob.benoit..1@xxxxxxxxx>
Also, look at things this way:
Suppose that you have a NxN matrix of doubles, with entries between -1
and 1, except in one row where entries are smaller than 1e-12.
For example (N=2):
Do you want to consider this matrix invertible or not?
The condition number is bad, but the matrix is certainly invertible to machine precision.
* if you consider it invertible, there's a risk that the 1e-12 entries
were just noise and were meant to be zeros
* if you consider it non invertible, there's a risk that the 1e-12
entries were really precise and were not just noise around zero
There's no way to tell in general. This isn't math -- from the math
point of view, "invertibility" only makes sense if you have infinite
precision, because invertible matrices form a dense subset i.e. any
matrix can be approached arbitrarily closely by invertible ones.
Since this isn't math, what it is? It's just a matter of common sense.
A matrix like discussed here is probably just a noisy non-invertible
matrix. Moreover: since 1e-12 is already dangerously close to the
machine epsilon, it would be crazy for the user to rely on it being
considered invertible. Which means that we (Eigen) can expect the user
to NOT rely on this matrix being considered invertible. E.g. the user,
if he's sane, won't call inverse() on it.
Exactly. The user is the one who should make that choice. I have had cases where I was working near machine precision, and got slightly innaccurate results, but it was fine because I then pushed the values through a minimizer.
If the matrix library had set a too-coarse precision then I couldn't have done this.
Unfortunately floating point template parameters are not allowed in C++.
That's why i'm being liberal in taking a coarse precision.
On the issue of making new criterion per algorithm: I think this is important. At least for the Cholesky case, the criterion described in the paper gave good results empirically. I would be surprised if we can't find good stopping criterion in the literature for each of the major algorithms.