Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-08-01 07:47:19


Daniel Egloff wrote:
> thanks for the proposal.
>
> It looks good. However I do not like the notation such as
>
> cdf_c(dist, x);
>
> for the complemented functions too much. The "_c" is not very visible.
> What's about
>
> complemented(cdf)(dist, x);
> cdf(complemented)(dist, x);
> cdf<complemented>(dist, x);
>
>
> Similarly for all other functions which have complemented versions. By
> the way, complemented only makes sense for 1 dimensional
> distributions. Did you think about multivariate distributions? There,
> the "tail" is the complement of a ball or an ellipsoid. But this
> becomes highly challenging already for moderate dimensions.
>
> I think the syntax for all 3 variations should be doable. My
> preferences are 2 or 3.
>
> What do you think?

Of those I would prefer (2), or else:

// complemented cdf:
cdf(complemented(dist, x));

// quantile from complement of probabilty:
quantile(complemented(dist, q));

// estimate degrees of freedom from t
// and complement of probablity:
students_t::estimate_degree_of_freedom(
   complemented(t, q));

I'm also tempted to suggest that "complemented" is spelled "complement".

I'd be interested to know what other think though.

As for the multivariate case, no we haven't thought about it (there's more
than enough to do at present in the univariate case), I suspect we would
have to fall back on "not all operations are supported on all
distributions", which would be not unreasonable in that case. A compiler
error in other words.

John.


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