[EMAIL PROTECTED] wrote:

It wouldn't make any difference to the end user as I guess he's supposed to use the DistributionFactory to create the distributions he need.


You could keep the ExponentialDistribution and ChiSquaredDistribution interfaces and just change the following in DistributionFactoryImpl:

public ChiSquaredDistribution createChiSquareDistribution(
final double degreesOfFreedom) {
return new GammaDistributionImpl(degreesOfFreedom/2, 2);
}


public ExponentialDistribution createExponentialDistribution(double mean) {
return new GammaDistributionImpl(1, mean);
}


Then you can drop ExponentialDistributionImpl and ChiSquaredDistributionImpl altogether.

I guess this is no big deal now but in general one should avoid having multiple implementations for the same distribution since that increases the risk for errors. In this case you could possibly argue that there is a small performance gain in having separate implementations, at least for the ExponentialDistribution.

Good point. I am +0 for dropping ChiSquaredDistributionImpl, but -1 for exponential (because of efficiency). Unless others object, I will make that change. Thanks for pointing this out.


Phil


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



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



Reply via email to