commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <>
Subject Re: [math] Questions regarding probability distributions
Date Thu, 14 Oct 2004 19:01:57 GMT

F Norin wrote:
> Yes you're right, with the parametrization model you're using it would 
> probably be confusing to simply let the exponential and chisquared 
> distributions be instances of a gammadistribution. However, this indicates 
> that there may be something flawed here. Remember, the chisquared 
> distribution *is a* gammadistribution, and this should be reflected in the 
> inheritance structure. Basically, you need some means to express 
> relationships between probability distributions.

Inheritance is not necessarily the best (or only) way to model such a 
relationship, adapters and wrappers are a very prevalent design pattern.

Java inheritance (single inheritance) is a poor choice for describing 
relationships such as this because the relationship between Gamma and 
ChiSquare is a "restriction of capability" not an "extension of 
capability". Yes, we could use inheritance and override the setBeta 
method to block its usage, but this violates all kinds of 
Interface/Implementation and expected behavior design rules too.

Is there a reason you need to have ChiSquare and Exponential extend 
Gamma instead of wrapping it or using an alternate efficient implementation?

Mark Diggory
Software Developer
Harvard MIT Data Center

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

View raw message