|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.algorithms.random.Poisson
public class Poisson
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.
Implementation: High performance implementation. Patchwork Rejection/Inversion method.
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.
Field Summary | |
---|---|
protected double |
c_pm
|
protected double |
dl
|
protected double |
dr
|
protected double |
f1
|
protected double |
f2
|
protected double |
f4
|
protected double |
f5
|
protected RandomElement |
gen
|
protected int |
k1
|
protected int |
k2
|
protected int |
k4
|
protected int |
k5
|
protected double |
l_my
|
protected double |
ll
|
protected int |
llll
|
protected double |
lr
|
protected int |
m
|
protected double |
mean
|
protected static double |
MEAN_MAX
|
protected double |
my_last
|
protected double |
my_old
|
protected double |
p
|
protected double |
p0
|
protected double |
p1
|
protected double |
p2
|
protected double |
p3
|
protected double |
p4
|
protected double |
p5
|
protected double |
p6
|
protected double[] |
pp
|
protected double |
q
|
protected double |
r1
|
protected double |
r2
|
protected double |
r4
|
protected double |
r5
|
protected static double |
SWITCH_MEAN
|
Constructor Summary | |
---|---|
Poisson(double mean)
Constructs a poisson distribution. |
Method Summary | |
---|---|
int |
nextInt()
Returns a random number from the distribution. |
int |
nextInt(double theMean)
Returns a random number from the distribution. |
void |
setMean(double mean)
Sets the mean. |
java.lang.String |
toString()
Returns a String representation of the receiver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected RandomElement gen
protected double mean
protected double my_old
protected double p
protected double q
protected double p0
protected double[] pp
protected int llll
protected double my_last
protected double ll
protected int k2
protected int k4
protected int k1
protected int k5
protected double dl
protected double dr
protected double r1
protected double r2
protected double r4
protected double r5
protected double lr
protected double l_my
protected double c_pm
protected double f1
protected double f2
protected double f4
protected double f5
protected double p1
protected double p2
protected double p3
protected double p4
protected double p5
protected double p6
protected int m
protected static final double MEAN_MAX
protected static final double SWITCH_MEAN
Constructor Detail |
---|
public Poisson(double mean)
Method Detail |
---|
public int nextInt()
public int nextInt(double theMean)
public void setMean(double mean)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |