Re: Testable Predictions by HdB
- From: "*** T. Winter" <***.Winter@xxxxxx>
- Date: Mon, 10 Oct 2005 11:58:11 GMT
In article <a0b88$434a4e33$82a1e3ad$13535@xxxxxxxxxxxxxxxx> Han de Bruijn <Han.deBruijn@xxxxxxxxxxxxxx> writes:
> *** T. Winter wrote:
> > My implementation of your algorithm on both 5 points and 9 points does
> > not even come close.
>
> Of course it "does not". I wrote:
>
> > You still don't get it. That stepsize is involved in an _integration_
> > (or: a summation with a truncation error). It extends over a distance
> > 2.2.pi.sigma where sigma = twice the sampling. Thus the "stepsize" in
> > my Numerical Differentiation method contains at least 25 samples with
> > weights ranging from 1/sqrt(2.pi) to zero.
You misunderstand the word stepsize. Stepsize is the distance between
successive samples. However, your article mentions nothing about all
that information (at least 25 points, etc.).
> Nevertheless you write:
>
> > As an afterthought I implemented your algorithm on 17, 33 and 65 points.
> > Increasing the number of points did increase the precision, except that
> > an increase from 33 to 65 points had no effect. With exp(x) the optimal
> > results are as follows:
> > 5 points 9 points 17 points 33 points 65 points
> > h 2^(0) 2^(-2) 2^(-6) 2^(-10) 2^(-10)
> > err 1.244e0 2.325e-1 3.335e-4 3.017e-6 3.017e-6
>
> You must have at least 25 points. Otherwise the "tails" of the Gaussians
> aren't neglectible < exp(-(2.pi)^2/2). And, of course, it's _impossible_
> to improve on that 25 pts result with even more points, i.e. 33 or 65.
Eh? When using the nontruncated version of exp (i.e. exp in double
precision) there *is* improvement going from 33 to 65 points. The
reason is (I think) that normally the result improves when you decrease
the stepsize (see my definition above). But when you make it too small,
rounding errors will become dominant, and with 33 points the rounding
errors will become dominant earlier than with 65 points. So there is
improvement.
> > Decreasing h beyond that figure indeed had bad effects on the precision.
> > Just as I "predicted".
>
> Worse. It's even possible to have an "underflow" with these Gaussians.
But originally you denied that you could make the stepsize too small.
> But you shouldn't do that. Just _calculate_ the number of points n
> you (always) need, with: n = 2*Round(4.pi)+1 = 25 or so.
I think that giving the data I find, using a 5-point lagrange interpolation
gives better precision, is simpler, and uses fewer function evaluations
(which can become important if the function is only available as an
algorithm, e.g. the integral of something).
> > (For my program see: <http://www.cwi.nl/~***/private/deriv.c>.)
>
> Yep. Got it. Unfortunately, we speak different computer languages as
> well, yours being C and mine being Pascal. I can read C , but I don't
> speak it (not fluently, at least). But I will take a closer look.
Oh, well, I currently do not have access to a Pascal compiler.
--
*** t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~***/
.
- Follow-Ups:
- Re: Testable Predictions by HdB
- From: Han de Bruijn
- Re: Testable Predictions by HdB
- References:
- Re: Testable Predictions by HdB
- From: Han . deBruijn
- Re: Testable Predictions by HdB
- From: *** T. Winter
- Re: Testable Predictions by HdB
- From: Han de Bruijn
- Re: Testable Predictions by HdB
- Prev by Date: Re: Me and David C. Ullrich
- Next by Date: Re: The meaning of 0/0
- Previous by thread: Re: Testable Predictions by HdB
- Next by thread: Re: Testable Predictions by HdB
- Index(es):