cern.jet.random.tdouble
Class Poisson
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.jet.random.tdouble.AbstractDoubleDistribution
-
- cern.jet.random.tdouble.AbstractDiscreteDistribution
-
- cern.jet.random.tdouble.Poisson
-
- All Implemented Interfaces:
- DoubleFunction, IntFunction, java.io.Serializable, java.lang.Cloneable
public class Poisson extends AbstractDiscreteDistribution
Poisson distribution (quick); See the math definition and animated definition.p(k) = (mean^k / k!) * exp(-mean) for k >= 0.
Valid parameter ranges: mean > 0. Note: if mean <= 0.0 then always returns zero.
Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
- Static methods operate on a default uniform random number generator; they are synchronized.
Implementation: High performance implementation. Patchwork Rejection/Inversion method.
- This is a port of pprsc.c from the C-RAND / WIN-RAND library. C-RAND's implementation, in turn, is based upon
H. Zechner (1994): Efficient sampling from continuous and discrete unimodal distributions, Doctoral Dissertation, 156 pp., Technical University Graz, Austria.
Also see
Stadlober E., H. Zechner (1999), The patchwork rejection method for sampling from unimodal distributions, to appear in ACM Transactions on Modelling and Simulation.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Poisson(double mean, DoubleRandomEngine randomGenerator)Constructs a poisson distribution.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecdf(int k)Returns the cumulative distribution function.java.lang.Objectclone()Returns a deep copy of the receiver; the copy will produce identical sequences.intnextInt()Returns a random number from the distribution.intnextInt(double theMean)Returns a random number from the distribution; bypasses the internal state.doublepdf(int k)Returns the probability distribution function.voidsetMean(double mean)Sets the mean.static intstaticNextInt(double mean)Returns a random number from the distribution with the given mean.java.lang.StringtoString()Returns a String representation of the receiver.-
Methods inherited from class cern.jet.random.tdouble.AbstractDiscreteDistribution
nextDouble
-
Methods inherited from class cern.jet.random.tdouble.AbstractDoubleDistribution
apply, apply, makeDefaultGenerator
-
-
-
-
Constructor Detail
-
Poisson
public Poisson(double mean, DoubleRandomEngine randomGenerator)Constructs a poisson distribution. Example: mean=1.0.
-
-
Method Detail
-
cdf
public double cdf(int k)
Returns the cumulative distribution function.
-
clone
public java.lang.Object clone()
Returns a deep copy of the receiver; the copy will produce identical sequences. After this call has returned, the copy and the receiver have equal but separate state.- Overrides:
clonein classAbstractDoubleDistribution- Returns:
- a copy of the receiver.
-
nextInt
public int nextInt()
Returns a random number from the distribution.- Specified by:
nextIntin classAbstractDiscreteDistribution
-
nextInt
public int nextInt(double theMean)
Returns a random number from the distribution; bypasses the internal state.
-
pdf
public double pdf(int k)
Returns the probability distribution function.
-
setMean
public void setMean(double mean)
Sets the mean.
-
staticNextInt
public static int staticNextInt(double mean)
Returns a random number from the distribution with the given mean.
-
toString
public java.lang.String toString()
Returns a String representation of the receiver.- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG