Ann: Statistics/Special Functions/Numeric Methods Toolkit

Gentlemen, This is to announce a new library added to the file vault, it is a work in progress and is intended to fulfil two needs: 1) To provide a small number of high quality special functions, initially these will be concentrated on functions used in statistical applications (with a strong nod towards Paul Bristow's existing work in this area). The functions currently implemented are the gamma/beta/erf functions along with the incomplete gamma and beta functions (four variants of each). All the implementations are fully generic and support the use of arbitrary "real-number" types, although they are optimised for use with types with known-about mantissa sizes: typically float, double or long double. Use of these functions with interval arithmetic (Boost.Interval) isn't quite supported yet, but it's something I want to investigate soon. 2) To provide at least some of the tools required to implement mathematical special functions, hopefully the presence of these will encourage other authors to contribute more special function implementations in the future. Currently implemented are helpers for the evaluation of infinite series, continued fractions and rational approximations. There are also classes for the manipulation of polynomials, for testing a special function against tabulated test data, and for the rapid generation of test data and/or data for output to an external graphing application. I've been keeping deliberately quiet about this for a while (with apologies to Paul Bristow), as I wanted to be certain that these special function implementations would offer something over and above what is available elsewhere. I still have some way to go here: erf and lgamma in particular still need work, but the incomplete gamma and beta functions already typically have 10 times lower error bounds than Cephes and GSL, and in one spectacular case 10^11 times more accurate (which is to say there is a domain of the incomplete gamma where Cephes and GSL have hardly any significant digits correct). Preliminary documentation is available here: http://www.johnmaddock.co.uk/toolkit and includes quite a lot of information already, including descriptions of implementation methodologies etc. There's also a roadmap of future work, open issues, and what needs to be done before a final release etc: http://www.johnmaddock.co.uk/toolkit/libs/math/doc/html/math_toolkit/status_... The actual source code, is available for download in the vault: http://boost-consulting.com/vault/index.php?action=downloadfile&filename=math-toolkit.zip&directory=& Regards, John Maddock.

| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of John Maddock | Sent: 31 March 2006 19:40 | To: Boost mailing list | Subject: [boost] Ann: Statistics/Special Functions/Numeric | Methods Toolkit Well you have been busy!!! This looks a considerable improvement over the use of the Cephes library, essentially a C library over which I am (was?) putting a C++ wrapper, especially in improved accuracy, efficiency, testing and general 'niceness' - no longer a kludge. I am/will be watching with great interest. Tell how I can help. Paul PS I have some concern about the names of functions, especially in the light of my C++ Standards proposal which is still 'on the table' (and some dreadful choices for C(( functions). But this is a minor detail - until it starts to be used in anger. -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html

This looks a considerable improvement over the use of the Cephes library, essentially a C library over which I am (was?) putting a C++ wrapper, especially in improved accuracy, efficiency, testing and general 'niceness' - no longer a kludge.
I am/will be watching with great interest.
Tell how I can help.
1) Tell me everything that's wrong with it :-) 2) I'll never compete with Cephes on breadth of functions provided, so if you want to chip in with any implementations feel free :-) The distribution and density functions along with test data would be a good place to start. 3) Suggestions for error handling would be very welcome. Currently they're just assertions that the input is in the required domain, potentially we could throw a domain_error and/or call a user defined handler. Although what the latter would look like for template code I'm not sure. There's also the question of what to do about infinite results, and/or evaluation at poles that have residual values (is this a domain error? It is at present), and/or what to do about results that underflow to zero (do folks need to know that the result is not *really* zero?).
PS I have some concern about the names of functions, especially in the light of my C++ Standards proposal which is still 'on the table' (and some dreadful choices for C(( functions). But this is a minor detail - until it starts to be used in anger.
I have lots of reservations as well. Originally I started following Mathematica's names, but they didn't always fit either :-( Probably the only ones I'm reasonably set on are the gamma_Q/gamma_P names which reasonably obviously link to the standard mathematical notation used for those functions. I don't like calling one of these a "complement" because it's not obvious to me at least, which is the complement! For the non-normalised versions the upper incomplete gamma is normally the main function GAMMA(a,x), and the lower incomplete gamma is the "sort of" complement with the lower case Greek letter. But that's the opposite of the sense sometimes used for the regularised versions. The P and Q notation is universal and unambiguous. I agree with you that "tgamma" is a very unfortunate choice that we're probably stuck with for historical reasons. On the other hand, we could just do our own thing :-) The incomplete beta function names I have no strong opinions over. John.

Nice documentation! May I ask, what tools were used to produce the docs, including math, in html?

Nice documentation! May I ask, what tools were used to produce the docs, including math, in html?
The docs are in quickbook (nice work guys BTW). The math was written with Mathcast which most of the time I love to bits (it still has a few rough edges, and the author seems to have moved on to other things at present, but it is non-the less a very usable tool). Mathcast produces MathML XML and can edit XHTML with embedded MathML directly. That's not a feature I've been able to use directly: at present in order to interface with quickbook I have to convert the equations to png's which is a big step backwards. It's theoretically possible to use DocBook with MathML, but I have no concept of what we would have to do to quickbook and the BoostBook XML toolchain to get it to play ball with that. John.

Nice documentation! May I ask, what tools were used to produce the docs, including math, in html?
I forgot to say, the graphs were in RSJ graph (http://www.rjsweb.net/). I could really use a good tool for producing 3D plots from a matrix of data points though. Intel's array visualiser should do it, but I can't get anything sensible out of it. Anyone any experience or suggestions for 3D plots? John.

"John Maddock" wrote
I could really use a good tool for producing 3D plots from a matrix of data points though. Intel's array visualiser should do it, but I can't get anything sensible out of it. Anyone any experience or suggestions for 3D plots?
If you have MS Excel it'll do simple 3d plots : http://www.servocomm.freeserve.co.uk/boost/testcomp.htm If thats what you mean ? regards Andy Little

On Sun, Apr 02, 2006 at 06:30:19PM +0100, John Maddock <john@johnmaddock.co.uk> wrote:
Nice documentation! May I ask, what tools were used to produce the docs, including math, in html?
I forgot to say, the graphs were in RSJ graph (http://www.rjsweb.net/).
I could really use a good tool for producing 3D plots from a matrix of data points though. Intel's array visualiser should do it, but I can't get anything sensible out of it. Anyone any experience or suggestions for 3D plots?
Gnuplot: [1] http://www.gnuplot.info/ Pstricks, if you aim for latex integration: [2] http://tug.org/PSTricks/main.cgi?file=pst-plot/3D/examples Regards Andreas Pokorny

I could really use a good tool for producing 3D plots from a matrix of data points though. Intel's array visualiser should do it, but I can't get anything sensible out of it. Anyone any experience or suggestions for 3D plots?
Gnuplot: [1] http://www.gnuplot.info/
Thanks, I'll look into that, John.

I was looking at series evaluation, and noticed that functors are required to declare result_type. Why not use boost::result_of?

I was looking at series evaluation, and noticed that functors are required to declare result_type. Why not use boost::result_of?
Um, I'm just behind the times, I'll have to look into the pro's and con's of that. John.
participants (6)
-
Andreas Pokorny
-
Andy Little
-
John Maddock
-
Neal Becker
-
Paul A Bristow
-
Paul Giaccone