public class PoissonDistributionImpl extends AbstractIntegerDistribution implements PoissonDistribution, java.io.Serializable
PoissonDistribution
.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_EPSILON
Default convergence criterion.
|
static int |
DEFAULT_MAX_ITERATIONS
Default maximum number of iterations for cumulative probability calculations.
|
Constructor and Description |
---|
PoissonDistributionImpl(double p)
Create a new Poisson distribution with the given the mean.
|
PoissonDistributionImpl(double p,
double epsilon)
Create a new Poisson distribution with the given mean and convergence criterion.
|
PoissonDistributionImpl(double p,
double epsilon,
int maxIterations)
Create a new Poisson distribution with the given mean, convergence criterion
and maximum number of iterations.
|
PoissonDistributionImpl(double p,
int maxIterations)
Create a new Poisson distribution with the given mean and maximum number of iterations.
|
PoissonDistributionImpl(double p,
NormalDistribution z)
Deprecated.
as of 2.1 (to avoid possibly inconsistent state, the
"NormalDistribution" will be instantiated internally)
|
Modifier and Type | Method and Description |
---|---|
double |
cumulativeProbability(int x)
The probability distribution function P(X <= x) for a Poisson
distribution.
|
double |
getMean()
Get the Poisson mean for the distribution.
|
double |
getNumericalVariance()
Returns the variance of the distribution.
|
int |
getSupportLowerBound()
Returns the lower bound of the support for the distribution.
|
int |
getSupportUpperBound()
Returns the upper bound of the support for the distribution.
|
double |
normalApproximateProbability(int x)
Calculates the Poisson distribution function using a normal
approximation.
|
double |
probability(int x)
The probability mass function P(X = x) for a Poisson distribution.
|
int |
sample()
Generates a random value sampled from this distribution.
|
void |
setMean(double p)
Deprecated.
as of 2.1 (class will become immutable in 3.0)
|
void |
setNormal(NormalDistribution value)
Deprecated.
as of 2.1 (class will become immutable in 3.0)
|
cumulativeProbability, cumulativeProbability, cumulativeProbability, inverseCumulativeProbability, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive, probability, reseedRandomGenerator, sample
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cumulativeProbability, inverseCumulativeProbability
probability
cumulativeProbability, cumulativeProbability
public static final int DEFAULT_MAX_ITERATIONS
public static final double DEFAULT_EPSILON
public PoissonDistributionImpl(double p)
IllegalArgument
is thrown.p
- the Poisson meanjava.lang.IllegalArgumentException
- if p ≤ 0public PoissonDistributionImpl(double p, double epsilon, int maxIterations)
p
- the Poisson meanepsilon
- the convergence criteria for cumulative probabilitesmaxIterations
- the maximum number of iterations for cumulative probabilitespublic PoissonDistributionImpl(double p, double epsilon)
p
- the Poisson meanepsilon
- the convergence criteria for cumulative probabilitespublic PoissonDistributionImpl(double p, int maxIterations)
p
- the Poisson meanmaxIterations
- the maximum number of iterations for cumulative probabilites@Deprecated public PoissonDistributionImpl(double p, NormalDistribution z)
IllegalArgument
is thrown.p
- the Poisson meanz
- a normal distribution used to compute normal approximations.java.lang.IllegalArgumentException
- if p ≤ 0public double getMean()
getMean
in interface PoissonDistribution
@Deprecated public void setMean(double p)
IllegalArgument
is thrown.setMean
in interface PoissonDistribution
p
- the Poisson mean valuejava.lang.IllegalArgumentException
- if p ≤ 0public double probability(int x)
probability
in interface IntegerDistribution
x
- the value at which the probability density function is
evaluated.public double cumulativeProbability(int x) throws MathException
cumulativeProbability
in interface IntegerDistribution
cumulativeProbability
in class AbstractIntegerDistribution
x
- the value at which the PDF is evaluated.MathException
- if the cumulative probability can not be computed
due to convergence or other numerical errors.public double normalApproximateProbability(int x) throws MathException
N(mean, sqrt(mean))
distribution is used
to approximate the Poisson distribution.
The computation uses "half-correction" -- evaluating the normal
distribution function at x + 0.5
normalApproximateProbability
in interface PoissonDistribution
x
- the upper bound, inclusiveMathException
- if an error occurs computing the normal
approximationpublic int sample() throws MathException
Algorithm Description:
sample
in class AbstractIntegerDistribution
MathException
- if an error occurs generating the random value@Deprecated public void setNormal(NormalDistribution value)
value
- the new distributionpublic int getSupportLowerBound()
public int getSupportUpperBound()
Integer.MAX_VALUE
and
AbstractIntegerDistribution.isSupportUpperBoundInclusive()
returns true
.Integer.MAX_VALUE
for positive infinity)public double getNumericalVariance()
p
, the variance is p
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"