Re: Testable Predictions by HdB
*** 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.
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.
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 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.
(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.
Han de Bruijn
.