sdsu.algorithms.data
Class Poisson
java.lang.Object
|
+--sdsu.algorithms.data.ProbabilityDistribution
|
+--sdsu.algorithms.data.DiscreteProbability
|
+--sdsu.algorithms.data.Poisson
- public class Poisson
- extends DiscreteProbability
The Poisson distrubution addresses the question of how many events
occur in a unit of time or space.
This class is adapted from Smalltalk-80: The language
and Its Implementation, Goldberg & Robson, Addison-Wesley, 1983, chapter 21,
pages 417-438.
- Version:
- 1.0 10 June 1997
- Author:
- Roger Whitney (whitney@cs.sdsu.edu)
Constructor Summary |
Poisson(double averageEvents)
Returns a Poisson distribution object. |
Method Summary |
double |
density(double numberOfEvents)
Returns the probability that numberOfEvents will occur
in one unit (time, space). |
double |
mean()
Returns the mean of the distribution |
double |
nextElement()
Returns the number events that occur in simualtion of
one unit (of time or space). |
double |
variance()
Returns the variance of the probability distribution |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Poisson
public Poisson(double averageEvents)
throws OutOfBoundsException
- Returns a Poisson distribution object.
- Parameters:
averageEvents
- the averate number of events happening per unit (time, space).- Throws:
- OutOfBoundsException - thrown if averageEvents is not greater than 0.0.
density
public double density(double numberOfEvents)
- Returns the probability that numberOfEvents will occur
in one unit (time, space).
- Parameters:
numberOfEvents
- does not make sense unless is integer value.- Overrides:
- density in class ProbabilityDistribution
mean
public double mean()
- Returns the mean of the distribution
- Overrides:
- mean in class ProbabilityDistribution
variance
public double variance()
- Returns the variance of the probability distribution
- Overrides:
- variance in class ProbabilityDistribution
nextElement
public double nextElement()
- Returns the number events that occur in simualtion of
one unit (of time or space).
- Overrides:
- nextElement in class ProbabilityDistribution