public class Poisson extends DiscreteDistribution
Constructor and Description |
---|
Poisson()
Creates a new Poisson distribution with λ = 1
|
Poisson(double lambda)
Creates a new Poisson distribution
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(int x)
Computes the value of the Cumulative Density Function (CDF) at the given point.
|
Poisson |
clone() |
double |
getLambda() |
double |
logPmf(int x)
Computes the log of the Probability Mass Function.
|
double |
max()
The maximum value for which the
#pdf(double) is meant to return
a value. |
double |
mean()
Computes the mean value of the distribution
|
double |
min()
The minimum value for which the
#pdf(double) is meant to return
a value. |
double |
mode()
Computes the mode of the distribution.
|
double |
pmf(int x) |
double[] |
sample(int numSamples,
Random rand)
This method returns a double array containing the values of random samples from this distribution.
|
void |
setLambda(double lambda)
Sets the average rate of the event occurring in a unit of time
|
double |
skewness()
Computes the skewness of the distribution.
|
double |
variance()
Computes the variance of the distribution.
|
cdf, invCdf, invCdf
getFunctionCDF, median, sampleVec, standardDeviation
public Poisson()
public Poisson(double lambda)
lambda
- the average rate of the eventpublic void setLambda(double lambda)
lambda
- the average rate of the event occurringpublic double getLambda()
public double logPmf(int x)
DiscreteDistribution
Double.NEGATIVE_INFINITY
would be the true
value. Instead, this method will always return the negative of
Double.MAX_VALUE
. This is to avoid propagating bad values through
computation.logPmf
in class DiscreteDistribution
x
- the value to get the log(PMF) ofpublic double pmf(int x)
pmf
in class DiscreteDistribution
public double cdf(int x)
DiscreteDistribution
cdf
in class DiscreteDistribution
x
- the value to get the CDF ofpublic double[] sample(int numSamples, Random rand)
Distribution
sample
in class Distribution
numSamples
- the number of random samples to takerand
- the source of randomnesspublic double mean()
Distribution
mean
in class Distribution
public double mode()
Distribution
NaN
may be returned if the mode is not defined for the current values of the
distribution.mode
in class Distribution
public double variance()
Distribution
NaN
may be
returned if the variance is not defined for the current values of the distribution.
Infinity
is a possible value to be returned
by some distributions.variance
in class Distribution
public double skewness()
Distribution
NaN
may be
returned if the skewness is not defined for the current values of the distribution.skewness
in class Distribution
public double min()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.NEGATIVE_INFINITY
is a valid return
value.min
in class Distribution
#pdf(double)
is meant to
return a value.public double max()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.POSITIVE_INFINITY
is a valid return
value.max
in class Distribution
#pdf(double)
is meant to
return a value.public Poisson clone()
clone
in class DiscreteDistribution
Copyright © 2017. All rights reserved.