Package com.imsl.stat
Class LogNormalDistribution
java.lang.Object
com.imsl.stat.LogNormalDistribution
- All Implemented Interfaces:
Distribution,ProbabilityDistribution,Serializable
Evaluates a lognormal probability density for a given set of data.
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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]eval(double[] xData) Fits a lognormal probability distribution toxDataand returns the probability density at each value.double[]Evaluates a lognormal probability distribution with a given set of parameters at each point inxDataand returns the probability density at each value.doubleEvaluates a lognormal probability density function at a given pointxData.doublegetMean()Returns the lognormal probability distribution mean parameter.Object[]Returns the current parameters of the lognormal probability density functiondoubleReturns the lognormal probability distribution standard deviation parameter.
-
Constructor Details
-
LogNormalDistribution
public LogNormalDistribution()
-
-
Method Details
-
eval
public double[] eval(double[] xData) Fits a lognormal probability distribution toxDataand returns the probability density at each value.- Specified by:
evalin interfaceDistribution- Parameters:
xData- adoublearray representing the points at which the lognormal probability distribution function is to be evaluated- Returns:
- a
doublearray representing the lognormal probability density at each value ofxData
-
eval
Evaluates a lognormal probability distribution with a given set of parameters at each point inxDataand returns the probability density at each value.- Specified by:
evalin interfaceProbabilityDistribution- Parameters:
xData- adoublearray representing the points at which the lognormal probability distribution function is to be evaluatedparameters- anObjectarray representing the parameters used to evaluate the lognormal distribution, see methodgetParameters- Returns:
- a
doublearray representing the lognormal probability density at each value ofxData
-
eval
Evaluates a lognormal probability density function at a given pointxData.- Specified by:
evalin interfaceProbabilityDistribution- Parameters:
xData- adoublerepresenting the point at which the lognormal probability distribution function is to be evaluatedparameters- anObjectarray representing the parameters used to evaluate the lognormal distribution, see methodgetParameters- Returns:
- a
doublerepresenting the lognormal probability density atxData
-
getParameters
Returns the current parameters of the lognormal probability density function- Specified by:
getParametersin interfaceProbabilityDistribution- Returns:
- an
Objectarray containing the parameters resulting from the last invocation of the (Distribution)evalmethod with the following signature,double[] eval(double[] xData). ThisObjectarray can be used as input to theevalmethods that require anObjectarray of distribution parameters as input.
-
getStandardDeviation
public double getStandardDeviation()Returns the lognormal probability distribution standard deviation parameter.- Returns:
- a
doublerepresenting the standard deviation parameter
-
getMean
public double getMean()Returns the lognormal probability distribution mean parameter.- Returns:
- a
doublerepresenting the mean parameter
-