[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binocdf inaccuracy in Octave
From: |
Dr. Alexander Klein |
Subject: |
Re: binocdf inaccuracy in Octave |
Date: |
Tue, 9 Jul 2013 12:47:41 +0200 |
Am 08.07.2013 um 22:10 schrieb Daniel J Sebald:
> We should be a little careful here. There was a discrepancy at one of the
> extreme ends of the function. Your modification may have just moved that
> discrepancy to the other end of the range, i.e., when the argument is 1e-3 as
> opposed to 1-1e-3.
Rik and Daniel,
thanks for the hints and the updated file!
As far as I can tell, Rik's new version produces correct results in most
relevant cases. The one remaining pitfall is that "at the other end of the
range" [Daniel], there are indeed many wrong results remaining:
- Firstly, as Daniel pointed out already, the new _and_ the old version will
both produce a long string of ones for binocdf(0:50,50,0.001), but this cannot
be remedied without resorting to multiple precision arithmetic, and the
relative error is very small, of course.
- Secondly, the "1 - p"-term introduces a new point where catastrophic
cancellation can occur, but only when p is _really_ small.
So, I think that Rik's patch should fix the problems for the most part.
Thanks again,
Alex
--
Dr. Alexander Klein, Diplom-Mathematiker
TransMIT-Projektbereich für Mathematische Analysen und Feld-Simulationen
Kerkrader Straße 3
D-35394 Gießen
http://www.transmit.de/zentren/tz.cfm?N=165