commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [MATH] RandomDataImpl
Date Tue, 14 Nov 2006 00:32:15 GMT

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.


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,

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

View raw message