|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.distribution.AbstractDistribution
org.apache.commons.math.distribution.AbstractIntegerDistribution
org.apache.commons.math.distribution.PoissonDistributionImpl
public class PoissonDistributionImpl
Implementation for the PoissonDistribution.
| Field Summary | |
|---|---|
static double |
DEFAULT_EPSILON
Default convergence criterion. |
static int |
DEFAULT_MAX_ITERATIONS
Default maximum number of iterations for cumulative probability calculations. |
| Constructor Summary | |
|---|---|
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) |
|
| Method Summary | |
|---|---|
double |
cumulativeProbability(int x)
The probability distribution function P(X <= x) for a Poisson distribution. |
protected int |
getDomainLowerBound(double p)
Access the domain value lower bound, based on p, used to
bracket a CDF root. |
protected int |
getDomainUpperBound(double p)
Access the domain value upper bound, based on p, used to
bracket a CDF root. |
double |
getMean()
Get the Poisson mean 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. |
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) |
| Methods inherited from class org.apache.commons.math.distribution.AbstractIntegerDistribution |
|---|
cumulativeProbability, cumulativeProbability, cumulativeProbability, inverseCumulativeProbability, probability |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.commons.math.distribution.IntegerDistribution |
|---|
cumulativeProbability, inverseCumulativeProbability |
| Methods inherited from interface org.apache.commons.math.distribution.DiscreteDistribution |
|---|
probability |
| Methods inherited from interface org.apache.commons.math.distribution.Distribution |
|---|
cumulativeProbability, cumulativeProbability |
| Field Detail |
|---|
public static final int DEFAULT_MAX_ITERATIONS
public static final double DEFAULT_EPSILON
| Constructor Detail |
|---|
public PoissonDistributionImpl(double p)
IllegalArgument is thrown.
p - the Poisson mean
IllegalArgumentException - if p ≤ 0
public PoissonDistributionImpl(double p,
double epsilon,
int maxIterations)
p - the Poisson meanepsilon - the convergence criteria for cumulative probabilitesmaxIterations - the maximum number of iterations for cumulative probabilites
public PoissonDistributionImpl(double p,
double epsilon)
p - the Poisson meanepsilon - the convergence criteria for cumulative probabilites
public 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.
IllegalArgumentException - if p ≤ 0| Method Detail |
|---|
public double getMean()
getMean in interface PoissonDistribution@Deprecated public void setMean(double p)
IllegalArgument is thrown.
setMean in interface PoissonDistributionp - the Poisson mean value
IllegalArgumentException - if p ≤ 0public double probability(int x)
probability in interface IntegerDistributionx - the value at which the probability density function is
evaluated.
public double cumulativeProbability(int x)
throws MathException
cumulativeProbability in interface IntegerDistributioncumulativeProbability in class AbstractIntegerDistributionx - 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 PoissonDistributionx - the upper bound, inclusive
MathException - if an error occurs computing the normal
approximationprotected int getDomainLowerBound(double p)
p, used to
bracket a CDF root. This method is used by
AbstractIntegerDistribution.inverseCumulativeProbability(double) to find critical values.
getDomainLowerBound in class AbstractIntegerDistributionp - the desired probability for the critical value
protected int getDomainUpperBound(double p)
p, used to
bracket a CDF root. This method is used by
AbstractIntegerDistribution.inverseCumulativeProbability(double) to find critical values.
getDomainUpperBound in class AbstractIntegerDistributionp - the desired probability for the critical value
@Deprecated public void setNormal(NormalDistribution value)
value - the new distribution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||