On 10/23/11 4:36 PM, Ted Dunning wrote:
> I think it isn't much to worry about forcing all the current stuff into an
> unnatural structure for use cases that are not particularly common.
>
> The cases that I have seen for distributions over non-reals are permutations
> and graphs.  In neither case did I feel an urge to file a bug against
> java.lang.Random because it returned a primitive double.

The one exception is our own IntegerDistribution, which is arguably
being forced into an unnatural structure because its sample space is
being artificially extended to R.  I am not sure how unnatural it
would be to just have the probability functions take a class
parameter.  I agree, though, that if there is no compelling
practical need, we should keep it simple.  Could be in that case,
though, that it might be better to pull DiscreteDistribution out of
the hierarchy and have its probability functions take ints rather
than doubles.  IIRC, I argued for that years ago, but others thought
it better to go with a single-rooted hierarchy.

Phil
>
> On Sun, Oct 23, 2011 at 2:15 PM, Phil Steitz <phil.ste...@gmail.com> wrote:
>
>> Comments on [math-692] have made me curious about how might we run
>> into discrete distributions that do not extend
>> AbstractIntegerDistribution in practical applications.  Does anyone
>> have the need for this?  One reason that I am asking about this is
>> that I have always felt a little funny about basically forcing
>> sample spaces of probability spaces to be subsets of R by the setup
>> we have.  The way we are forced to remap values in
>> IntegerDistribution is a little smelly and to actually compute
>> anything for discrete distributions in the current setup, their
>> sample spaces have to be mapped to some subset of the integers. I
>> like the setup for classical continuous distributions over R and can
>> live with it for discrete distributions over Z, which is all that we
>> have ever implemented.  To model the more general case, we would
>> have to parameterize the type of the sample space.  This may make
>> sense and have value in the discrete case; but if done at the top of
>> the hierarchy it would complicate things for the currently
>> implemented distributions and force use of Double everywhere in
>> place of double.  If the only practical use case we can identify is
>> discrete distributions over non-Integer domains, we could just
>> create some kind of adapter.  Any thoughts on this?
>>
>> Phil
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> For additional commands, e-mail: dev-h...@commons.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to