public class PoissonSlow extends AbstractDiscreteDistribution
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.
Implementation: This is a port of RandPoisson used in CLHEP 1.4.0 (C++). CLHEP's implementation, in turn, is based upon "W.H.Press et al., Numerical Recipes in C, Second Edition".
Modifier and Type | Field and Description |
---|---|
protected double |
cached_alxm |
protected double |
cached_g |
protected double |
cached_sq |
protected static double[] |
cof |
protected double |
mean |
protected static double |
MEAN_MAX |
protected static PoissonSlow |
shared |
protected static double |
SWITCH_MEAN |
randomGenerator
serialVersionUID
Constructor and Description |
---|
PoissonSlow(double mean,
RandomEngine randomGenerator)
Constructs a poisson distribution.
|
Modifier and Type | Method and Description |
---|---|
static double |
logGamma(double xx)
Returns the value ln(Gamma(xx) for xx > 0.
|
int |
nextInt()
Returns a random number from the distribution.
|
protected int |
nextIntSlow()
Returns a random number from the distribution.
|
void |
setMean(double mean)
Sets the mean.
|
static int |
staticNextInt(double mean)
Returns a random number from the distribution with the given mean.
|
String |
toString()
Returns a String representation of the receiver.
|
nextDouble
apply, apply, clone, getRandomGenerator, makeDefaultGenerator, setRandomGenerator
protected double mean
protected double cached_sq
protected double cached_alxm
protected double cached_g
protected static final double MEAN_MAX
protected static final double SWITCH_MEAN
protected static final double[] cof
protected static PoissonSlow shared
public PoissonSlow(double mean, RandomEngine randomGenerator)
public static double logGamma(double xx)
public int nextInt()
nextInt
in class AbstractDiscreteDistribution
protected int nextIntSlow()
public void setMean(double mean)
public static int staticNextInt(double mean)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.