commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject Re: [math] Generate random data using the Inverse CDF Method?
Date Tue, 27 Oct 2009 01:01:18 GMT
Mikkel Meyer Andersen wrote:
> Ted: No, I mean with the discrete inverse cdf. But anyway. Thanks for
> clarifying the points.
> Phil, if you're not convinced, I'll be happy to provide a
> patch-draft/prototype of code so you can see exactly what I mean?
> If we were to put a generator in the distributions (for supporting the
> specialised generators), should this method then just be parameterised
> by a RandomGenerator? Or what would be a proper approach?

That is part of the reason that I would rather see random data
generation remain in the random package.  That way the
RandomGenerator can be easily configured.  It is also better
separation of concerns.  There are lots of things that one can do
with probability distributions, including generate random data
following them.  That does not mean all of these things should be in
the distribution implementation classes.

I now understand your point about a missing interface. I would be
fine with adding a HasInverse or HasInverseCumulativeDistribution
interface to mark invertible distributions and then adding a generic
nextDeviate to RandomDataImpl.  I am also open to deprecating
RandomData/RandomDataImpl and refactoring the setup there.  What I
am -1 on is adding (potentially poor) random data generation to the
distributions implementations.

> 2009/10/27 Ted Dunning <>:
>> That was Phil. (not that it matters)
>> +1 for the idea of a default generator for all distributions that define a
>> cumulative density.
>> +1 as well for specialized implementations where possible that over-ride the
>> default generator even if it exists.
>> I can't imagine much dispute on either of these points because they satisfy
>> the general principle of doing the best we can for all cases as well as for
>> special cases.
>> I also completely agree with Mikkel with not understanding why the
>> generation of deviates is separated from the distribution.
>> On Mon, Oct 26, 2009 at 5:11 PM, Mikkel Meyer Andersen <> wrote:
>>> Ted, sorry hadn't seen your e-mail before sending mine.
>>> Yes, I agree in you point of having specialised good algorithms. But
>>> in lack of such methods, I'd prefer being able to have a general
>>> method, although it might be bad compared to a specialised one.
>>> 2009/10/27 Phil Steitz <>:
>>>> Thanks.  That's what I was missing. I would still rather see the
>>>> implementations in the random package and for common distributions,
>>>> e.g. Poisson, pick a method that is well-suited for the distribution.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message