commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dneuf...@geovelocity.com
Subject [MATH] RandomDataImpl
Date Tue, 14 Nov 2006 00:32:15 GMT
Hello,

I am using the nextPoisson method of the RandomDataImpl in
commons-math-1.1.jar and having problems as the size of the population
mean value increases.

Code:

package util;

import org.apache.commons.math.random.JDKRandomGenerator;
import org.apache.commons.math.random.RandomDataImpl;

public class PoissonEstimator {

	  public double getEstimate(JDKRandomGenerator rand, double popMean) {
		  double estimate;

          RandomDataImpl rdi = new RandomDataImpl(rand);
		  estimate = rdi.nextPoisson(popMean);

		  System.out.println("posisson estimate=" + estimate);

		  return estimate;
	  }

		//Unit test
		public static void main(String[] args) {
			PoissonEstimator pe = new PoissonEstimator();
			JDKRandomGenerator jdkRandGenerator = new JDKRandomGenerator();
			pe.getEstimate(jdkRandGenerator, 650);

		}
}

so for example a value of 650 returns an expected response, while a value
of 900 returns a value off by a factor of 1000.

Has anyone ran into this before? Am I missing something obvious?  Is it a
bug and if so where should I report the bug (didn't see any entries for
ASF commons in bugzilla).

Many thanks,
Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message