Re: [boost] [statistics] design/interface reprise

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.

John Maddock wrote:
Daniel Egloff wrote:
What's about
complemented(cdf)(dist, x); cdf(complemented)(dist, x); cdf<complemented>(dist, x);
Of those I would prefer (2), or else:
// complemented cdf: cdf(complemented(dist, x));
// quantile from complement of probabilty: quantile(complemented(dist, q));
I'm also tempted to suggest that "complemented" is spelled "complement".
I'd be interested to know what other think though.
I was happy with cdf_c, but this syntax looks good to me, too. I also prefer "complement" over "complemented".
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.
I definitely recommend sticking to univariate distributions for now. Multivariate ones open up too many questions.
participants (2)
-
Deane Yang
-
John Maddock