 # Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-07-12 12:08:01

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Topher Cooper
| Sent: 12 July 2006 14:11
| To: boost_at_[hidden]
| Subject: Re: [boost] [math/staticstics/design] How
| besttonamestatisticalfunctions?

| This brings to mind another function that, though easily derived
| would be good to have to allow internal computations less subject to
| round-off error. This is a two parameter function that is the
| cumulative probability between a lower and an upper
| bound. Mathematically this can always be computed as "CDF(x[ub]) -
| CDF(x[lb])" (read the square brackets as mathematical subscript
| notation) but numerically with very small intervals, you can easily
| end up with 0 when you want something close to
| "PDF((x[ub]+x[lb])/2)*(x[ub]-x[lb])".

An interesting suggestion.

functions.
It's on his TODO list allegedly ;-)

Would this help with the "CDF(x[ub]) - CDF(x[lb])"?

And/or allow one to produce "PDF((x[ub]+x[lb])/2)*(x[ub]-x[lb])"
using the density/mass/distribution?

| You don't need to make any
| general guarantee about precision and so could do initial
| implementations as the difference of the cumulative functions, but
| then go back and do better for individual distributions.
|
| I don't know any standard term for this off the top of my head. I
| would suggest just using a two argument version of whatever is
| decided on for the cumulative distribution. So, using my suggested
| function name:
|
| standard_normal.cdf(-1.0, 1.0)
|
| would return the probability that a random variate with a normal
| distribution is within one standard deviation of the mean.
|
| The only problem I have with this is that if we look at the one
| parameter version as being the two parameter version with one
| parameter defaulted its the *first* parameter that is
| defaulted since:
|
| dist.cdf(x) = dist.cdf(-INFINITY, x)
|
| That would suggest using the complementary cdf instead, but that
| seems a lot less natural.

The language doesn't make this natural :-(

Paul

```---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]

```