Package com.imsl.stat

Class LogNormalDistribution

java.lang.Object
com.imsl.stat.LogNormalDistribution
All Implemented Interfaces:
Distribution, ProbabilityDistribution, Serializable

public class LogNormalDistribution extends Object implements 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    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
    Returns the lognormal probability distribution mean parameter.
    Returns the current parameters of the lognormal probability density function
    double
    Returns the lognormal probability distribution standard deviation parameter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogNormalDistribution

      public LogNormalDistribution()
  • Method Details

    • eval

      public double[] eval(double[] xData)
      Fits a lognormal probability distribution to xData and returns the probability density at each value.
      Specified by:
      eval in interface Distribution
      Parameters:
      xData - a double array representing the points at which the lognormal probability distribution function is to be evaluated
      Returns:
      a double array representing the lognormal probability density at each value of xData
    • eval

      public 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.
      Specified by:
      eval in interface ProbabilityDistribution
      Parameters:
      xData - a double array representing the points at which the lognormal probability distribution function is to be evaluated
      parameters - an Object array representing the parameters used to evaluate the lognormal distribution, see method getParameters
      Returns:
      a double array representing the lognormal probability density at each value of xData
    • eval

      public double eval(double xData, Object[] parameters)
      Evaluates a lognormal probability density function at a given point xData.
      Specified by:
      eval in interface ProbabilityDistribution
      Parameters:
      xData - a double representing the point at which the lognormal probability distribution function is to be evaluated
      parameters - an Object array representing the parameters used to evaluate the lognormal distribution, see method getParameters
      Returns:
      a double representing the lognormal probability density at xData
    • getParameters

      public Object[] getParameters()
      Returns the current parameters of the lognormal probability density function
      Specified by:
      getParameters in interface ProbabilityDistribution
      Returns:
      an 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.
    • getStandardDeviation

      public double getStandardDeviation()
      Returns the lognormal probability distribution standard deviation parameter.
      Returns:
      a double representing the standard deviation parameter
    • getMean

      public double getMean()
      Returns the lognormal probability distribution mean parameter.
      Returns:
      a double representing the mean parameter