Boost logo

Boost :

From: Deane Yang (deane_yang_at_[hidden])
Date: 2006-07-10 16:40:56


Paul A Bristow wrote:
> | -----Original Message-----
> | From: Kevin Lynch

> | Why not hide the functions behind a class interface? After all, the
> | various functions are "properties" of the distributions. Hence:
> |
> | class students_t {
> | students_t(double mu);
> | double P(double x);
> | double Q(double x);
> | double invP(double p); (or perhaps inverseP or Pinv or
> | something)
> | .....
> | }
> |
> | class normal {
> | normal(double mu, double sigma);
> | double P(double x);
> | double Q(double x);
> | double invP(double x);
> | ......
> | }
>
> Rather interesting idea.

I support Kevin's proposal rather strongly for exactly the reasons he
states. But I'm not sure what P, Q, invP mean. I would prefer:

double density(double x);
double cumulative(double x);
double inverse_cumulative(double y);

> How would you envisage this working with Fisher, for example which has
> degrees of freedom 1 and 2, and a variance ratio.
>
> Is this a 1D or 2D or 3D?
>
> Its inversion will return df1 (given df2 and F and Probability)
> or df2 (given df1, F and Prob)
> or F (given Df1 and df2 and Prob)
>
> WOuld you like to flesh out how you suggest handling all these?
>

Could you clarify your question? Isn't the F distribution still the
probability distribution of a single real random variable? The
cumulative and inverse cumulative density functions have a consistent
mathematical meaning for any 1-dimensional probability distribution, do
they not?


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