public class PoissonDistribution extends Object implements ProbabilityDistribution, Serializable
The poissonDistribution
evaluates the Poisson probability
density of a given set of data, xData
. If parameters are not
supplied, the eval
method fits the Poisson probability density
function by first calculating theta, \(\theta\).
The Poisson probability density function is defined as:
$$f(x)= \frac{\theta^{x}e^{-\theta}}{x!}\,\,\mbox{,}\,\, x \ge 0\,\,\, \mbox{and}\,\,\, \theta > 0 \mbox{.}
$$
The DataMining
package class NaiveBayesClassifier
uses PoissonDistribution
as a method to train continuous data.
Constructor and Description |
---|
PoissonDistribution() |
Modifier and Type | Method and Description |
---|---|
double[] |
eval(double[] xData)
Fits a Poisson probability distribution to
xData and
returns the probability density at each value. |
double[] |
eval(double[] xData,
Object[] parameters)
Evaluates a Poisson probability distribution with a given set of
parameters at each point in
xData and returns the
probability density at each value. |
double |
eval(double xData,
Object[] parameters)
Evaluates a Poisson probability density function at a given point
xData . |
Object[] |
getParameters()
Returns the current parameters of the Poisson probability
density function.
|
double |
getTheta()
Returns the mean number of successes in a given time period of the
Poisson probability distribution.
|
public double[] eval(double[] xData)
xData
and
returns the probability density at each value.eval
in interface Distribution
xData
- a double
array representing the points at
which the Poisson probability distribution function is to
be evaluateddouble
array representing the Poisson probability
density at each value of xData
public double[] eval(double[] xData, Object[] parameters)
xData
and returns the
probability density at each value.eval
in interface ProbabilityDistribution
xData
- a double
array representing the points at which
the Poisson probability distribution function is to be
evaluatedparameters
- an Object
array representing the
parameters used to evaluate the Poisson distribution,
see method getParameters
.double
array representing the Poisson
probability density at each value of xData
public double eval(double xData, Object[] parameters)
xData
.eval
in interface ProbabilityDistribution
xData
- a double
representing the point at which the
Poisson probability distribution function is to be evaluatedparameters
- an Object
array representing the
parameters used to evaluate the Poisson distribution,
see method getParameters
double
representing the Poisson probability
density at xData
public Object[] getParameters()
getParameters
in interface ProbabilityDistribution
Object
array containing the parameters
resulting from the last invocation of the
(Distribution
) eval
method with
the following signature,
double[] eval(double[] xData)
. This
Object
array can be used as input to the
eval
methods that require an Object
array of distribution parameters as input.public double getTheta()
double
representing the mean number of successes
in a given time period of the Poisson probability distributionCopyright © 2020 Rogue Wave Software. All rights reserved.