Utility
Class Poisson

java.lang.Object
  |
  +--Utility.RandomNumber
        |
        +--Utility.Poisson

public class Poisson
extends RandomNumber

The Poisson class is used to generate random variables from a Poisson distribution.
The Poisson distribution is often used to model the total number of arrivals during a fixed time period.

This is a discrete distribution.

Tests Performed
1000 samples were generated and the means and variances were examined. Subjectively, they seemed correct. A goodness of fit test was performed with 100 samples and 10 intervals. It seems to fail about 16/20 times. This might be due to the fact that it is a discrete distribution and it wasn't possible to make the probabilies for the different intervals identical.

See Also:
Exponential

Constructor Summary
Poisson(double mean)
          The Poisson constructor initializes the Poisson distribution by setting the distribution's mean.
 
Method Summary
 double getMean()
           
 double sampleDouble()
          Draw a random sample.
 int sampleInt()
          Generate a random variable, an int, from the poisson distribution.
 
Methods inherited from class Utility.RandomNumber
goodnessOfFitTest, goodnessOfFitTest, randomMixer, resetRandomMixer, sample01
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Poisson

public Poisson(double mean)
The Poisson constructor initializes the Poisson distribution by setting the distribution's mean.

Parameters:
mean - The mean of the poisson distribution. The mean alone characterizes the poisson distribution.
Method Detail

getMean

public double getMean()

sampleInt

public int sampleInt()
Generate a random variable, an int, from the poisson distribution.

Overrides:
sampleInt in class RandomNumber
Returns:
The int representing a random draw from the poisson distribution.

sampleDouble

public double sampleDouble()
Description copied from class: RandomNumber
Draw a random sample. This function should be overridden by all derived classes. The RandomNumber class returns a uniform double in the interval [0,1).

Overrides:
sampleDouble in class RandomNumber