math whizzes: where do the magic numbers in the horner's method solution for an error function come from?https://github.com/simple-statistics/simple-statistics/issues/355 …
That's exactly right. The book cited by the wikipedia link in the source code of errorFunction is, of course, Numerical Recipes (which actually used Horner evaluation in their code). After some fiddling, I think I understand what the idea is:pic.twitter.com/5ojShLnvvW
-
-
Here's a screenshot from a newer edition of NR which is a little more explicit than "inspired guess". The important part is that for all positive z, t is between 0 and 1. This makes the function P(t) suitable for approximation by Chebyshev polynomials https://en.wikipedia.org/wiki/Chebyshev_polynomials …pic.twitter.com/6UPkIHfe3l
-
A long and boring computation that I am not up for ought to confirm that the magic numbers arise from doing a 9th order (the final polynomial is degree 9) Chebyshev approximation to the function P(t) there.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.