public class LogNormalDistribution extends Object implements ProbabilityDistribution, Serializable
LogNormalDistribution
evaluates the lognormal probability
density of a given set of data, xData
. If parameters are not
supplied, the eval
method fits the lognormal probability
density function to the data by first calculating the mean and standard
deviation. The lognormal probability density function is defined as:
$$f(x) = \frac{1}{x \sigma \sqrt{2 \pi} }e^{- \frac{{ \left( \ln(x) - \mu \right)}^2}{2 { \sigma}^2}}
$$ where \(\mu\) and \(\sigma\)
are the mean and standard deviation.
The DataMining
package class NaiveBayesClassifier
uses LognormalDistribution
as a method to train continuous
data.
Constructor and Description |
---|
LogNormalDistribution() |
Modifier and Type | Method and Description |
---|---|
double[] |
eval(double[] xData)
Fits a lognormal probability distribution to
xData and
returns the probability density at each value. |
double[] |
eval(double[] xData,
Object[] parameters)
Evaluates a lognormal 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 lognormal probability density function at a given point
xData . |
double |
getMean()
Returns the lognormal probability distribution mean parameter.
|
Object[] |
getParameters()
Returns the current parameters of the lognormal probability
density function
|
double |
getStandardDeviation()
Returns the lognormal probability distribution standard deviation parameter.
|
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 lognormal probability distribution function is
to be evaluateddouble
array representing the lognormal
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 lognormal probability distribution function is
to be evaluatedparameters
- an Object
array representing the
parameters used to evaluate the lognormal distribution,
see method getParameters
double
array representing the lognormal
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
lognormal probability distribution function is to be
evaluatedparameters
- an Object
array representing the
parameters used to evaluate the lognormal distribution,
see method getParameters
double
representing the lognormal 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 getStandardDeviation()
double
representing the standard deviation parameterpublic double getMean()
double
representing the mean parameterCopyright © 2020 Rogue Wave Software. All rights reserved.