Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2004-11-09 11:36:02


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Matt Austern
| Sent: 08 November 2004 20:17
| To: boost_at_[hidden]
| Subject: Re: [boost] Math functions - requirements 'spec'
|
| On Mon, 8 Nov 2004 19:16:49 -0000, Paul A Bristow
| <pbristow_at_[hidden]> wrote:
| >
| >
<snip>

| Some possible alternatives that might change people's minds:
| - Show that doing a good job, i.e. implementing these functions with
| the same sort of accuracy as a high-quality implementation achieves
| for sqrt or cos or lgamma or cyl_bessel_j, is easier than people
| thought.
| - Convince people that, in the case of these particular functions
| you're proposing, they should lower their standards for what a good
| job is.
| - Convince people that these functions are more important than they
| thought, so that even if folks think this is an extremely difficult
| implementation task they'll still think that the cost/benefit ratio is
| worth it.
|
| If you're going for point 3 then you might want to consider broadening
| your scope instead of narrowing it. One point that some people made
| at the Redmond meeting is that most people who want to do statistics
| use a statistical package, i.e. something that operates on data sets,
| rather than just using bare transcendental functions and writing all
| the data set manipulation themselves. It's possible that people would
| see a different cost/benefit tradeoff in a statistical package than in
| a collection of more special functions.

Well I agree people might like a 'package',
but I find this a surprising suggestion
considering the sorts of things currently Standardised.

But the functions are not too far from what one actually would use,
whereas getting the data in place is what the STL containers are 'about',
and yet there are many different containers for data, from C arrays upwards.

For a specific simple example, cribbing a bit from NR in C++,

if we get two sets of measurements in two arrays data1 and data2,
and get their sizes into size1 and size2
and their means and variances into mean1 & mean2 and variance1 & variance2,
and the 'degrees of freedom' using published formulae (and probably
std::algorithm?)
(other 'Standard' functions perhaps - but pretty trivial)

pooled_variance = (size1-1)*variance1 + (size2-1)*variance2)/df;
double t = (mean1 - mean2)/sqrt(pooled_variance*(1./size1 + 1./size2));

probability_of_significantly_different = incomplete_beta(df, 0.5, df/(df + t
* t));

if(probability_of_significantly_different > 0.95)
{
  cout << "Batches differ!" << endl; // and/or Action!
}

(In contrast, stats packages report a lot of clutter,
intelligible mainly to statisticians, but largely uninformative to users).

Nonetheless, many thanks for your thoughts and helpful suggestions.

I'll see what I can do.

Paul

Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
mailto: pbristow_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk