public class NormalDistribution extends Object implements ProbabilityDistribution, Serializable
NormalDistribution evaluates the normal probability density
of a given set of data, xData. If parameters are not supplied,
the eval method fits the normal probability density function
to the data by first calculating the mean and standard deviation of
xData. The normal probability density function is defined as:
![]()
The DataMining package class NaiveBayesClassifier
uses NormalDistribution as the default method to train
continuous data.
| Constructor and Description |
|---|
NormalDistribution() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
eval(double[] xData)
Fits a normal (Gaussian) probability distribution to
xData
and returns the probability density at each value. |
double[] |
eval(double[] xData,
Object[] parameters)
Evaluates a normal (Gaussian) probability distribution with the given
parameters at each point in
xData and returns the
probability density at each value. |
double |
eval(double xData,
Object[] parameters)
Evaluates a normal (Gaussian) probability density at a given point
xData. |
double |
getMean()
Returns the population mean of
xData. |
Object[] |
getParameters()
Returns the current parameters of the normal probability
density function.
|
double |
getStandardDeviation()
Returns the population standard deviation.
|
public double[] eval(double[] xData)
xData
and returns the probability density at each value.eval in interface DistributionxData - a double array representing the points at
which the normal probability distribution function is to be
evaluateddouble array representing the normal probability
density at each value in xDatapublic double[] eval(double[] xData,
Object[] parameters)
xData and returns the
probability density at each value.eval in interface ProbabilityDistributionxData - a double array representing the points at
which the normal probability distribution function is to
be evaluatedparameters - an Object array representing the
parameters used to evaluate the normal probability
density function, see method getParametersdouble array representing the normal probability
density of each value in xDatapublic double eval(double xData,
Object[] parameters)
xData.eval in interface ProbabilityDistributionxData - a double containing the point at which the
normal probability density function is to be evaluatedparameters - an Object array representing the
parameters used to evaluate the normal probability
density, see method getParametersdouble representing the normal probability
density at xDatapublic double getMean()
xData.double representing the population mean of
xDatapublic Object[] getParameters()
getParameters in interface ProbabilityDistributionObject 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 getStandardDeviation()
double representing the population standard
devation of xDataCopyright © 1970-2015 Rogue Wave Software
Built March 24 2015.