Downloaded today and playing around with ... Created a new
NormalDistribution object, nd, with the constructor
NormalDistribution(double[] array). Called nd.getVariance() and it
is returning a negative number. If this method is supposed to return
the sample variance, then the following line of code, line 46:
variance=mean*mean-sumX2/array.length;
should be changed to:
variance = (sumX2 - array.length*mean*mean)/(array.length - 1);
Is my thinking correct that getVariance() should return the sample
variance after using the constructor with a data set?
~matt