Mark,

> Piotr,
> 
> I will add these in, I'd like to work to see us move to have a separate 
> package for CDF's (I expect to place the Gamma and Beta functions there 
> as well and to unify all these CDF style functions under one interface.
> 
> Basically we would have:
> 
> o.a.c.math.function
> 
> Beta
> Gamma
> Normal
> FastNormal
> PreciseNormal
> ...
> 
> o.a.c.math.distribution
> Normal
> Gamma
> Binomial
> ....

That sounds ok. as a side effect there will be error function (Erf(x))
available,
which is just normal CDF with a different normalization (as far as I can
rememeber).

> > In fact the fast algorithm
> > is precise enough to be used in a majority of real-life
> > applications (especially in social sciences).
> > 
> > Code which calculates CDF is in the mentioned files, the code
> > for the inverse CDF is in the NormalDistributionImpl.java. This
> > is what really matters.
> 
> Is it logical to consider having the inverse available in the Function 
> interface and not the Distribution?

This would add some flexibility - now some functions are kind of
hidden in the distributions - one might want to use them without knowing
about normal or any other distribution. 

Separation of functions from the particular application - here it is some 
utility to play with normal, t, etc. distribution - is reasonable. 

Math could be used then by people who has no idea what is 
normal distribution but still need the normal integral.

> > I am not quite convinced that for probability p=0 and p=1 inverse CDF
> > should
> > return NaN, maybe a better solution would be to return
> > Double.NEGATIVE_INFINITY
> > for p=0 and Double.POSITIVE_INFINITY for p=1. Any suggestions?
> > 
> 
> Well in the mathematical solution they would be infinite, wouldn't they? 
> In such case this may be logical. I suspect if p<0 or p>1 they should be 
> NaN.

Yes, I guess so, having some free time I'll go through all distribution
functions and patch this. The NaN has also some meaning since in practice
it should never happen that p=0 or p=1 statistics never gives 100%
answers...
 

Cheers

Piotr Kochanski

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to