org.jscience.mathematics.statistics
Class LogNormalDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.LogNormalDistribution
All Implemented Interfaces:
java.io.Serializable

public class LogNormalDistribution
extends Distribution
implements java.io.Serializable

This class models the lognormal distribution with specified parameters. This is the distribution of Y = exp(X) where X has a normal distribution with the parameters.

See Also:
Serialized Form

Field Summary
static double C
          DOCUMENT ME!
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
LogNormalDistribution()
          This default constructor creates the standard lognormal distribution.
LogNormalDistribution(double m, double s)
          This general constructor creates a new lognormal distribution with specified parameters.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function.
 double getDensity(double x)
          This method computes the probability density function.
 double getLocation()
          This method returns the location parameter of ln(Y).
 double getMaxDensity()
          This method computes the maximum value of the density function.
 double getMean()
          This method computes the mean of the distribution.
 double getMGF(double t)
          This method computes the moment generating function.
 double getMoment(double a, int n)
          This method returns the moment of a specified order about a specified point.
 double getMoment(int n)
          This method computes the moment of a specified order.
 double getScale()
          This method gets the scale parameter of ln(Y).
 double getVariance()
          This method computes the variance of the distribution.
 void setLocation(double m)
          This method sets the location parameter of ln(Y).
 void setParameters(double m, double s)
          This method sets the parameters, computes the default domain.
 void setScale(double s)
          This method sets the scale parameter of ln(Y).
 double simulate()
          This method simulates a value from the distribution.
 java.lang.String toString()
          This method returns a string that gives the name of the distribution and the values of the parameters.
 
Methods inherited from class org.jscience.mathematics.statistics.Distribution
getDomain, getFailureRate, getMedian, getPGF, getQuantile, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

C

public static final double C
DOCUMENT ME!

Constructor Detail

LogNormalDistribution

public LogNormalDistribution(double m,
                             double s)
This general constructor creates a new lognormal distribution with specified parameters.

Parameters:
m - the location parameter of ln(Y)
s - the scale parameter of ln(Y)

LogNormalDistribution

public LogNormalDistribution()
This default constructor creates the standard lognormal distribution.

Method Detail

setParameters

public void setParameters(double m,
                          double s)
This method sets the parameters, computes the default domain.

Parameters:
m - the location parameter of ln(Y)
s - the scale parameter of ln(Y)

getDensity

public double getDensity(double x)
This method computes the probability density function.

Specified by:
getDensity in class Distribution
Parameters:
x - a number in the domain of the distribution [0, ∞)
Returns:
the probability density at x

getMaxDensity

public double getMaxDensity()
This method computes the maximum value of the density function.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum value of the probability density function

getMean

public double getMean()
This method computes the mean of the distribution.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method computes the variance of the distribution.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMoment

public double getMoment(int n)
This method computes the moment of a specified order.

Overrides:
getMoment in class Distribution
Parameters:
n - the order
Returns:
the moment of order n about 0

getMoment

public double getMoment(double a,
                        int n)
This method returns the moment of a specified order about a specified point.

Overrides:
getMoment in class Distribution
Parameters:
a - the center
n - the order
Returns:
the moment of order n about a

getMGF

public double getMGF(double t)
This method computes the moment generating function.

Overrides:
getMGF in class Distribution
Parameters:
t - a real number
Returns:
the moment genrating function at t

simulate

public double simulate()
This method simulates a value from the distribution.

Overrides:
simulate in class Distribution
Returns:
a simulated value from the distribuiton

getLocation

public double getLocation()
This method returns the location parameter of ln(Y).

Returns:
the location parameter

setLocation

public void setLocation(double m)
This method sets the location parameter of ln(Y).

Parameters:
m - the location parameter

getScale

public double getScale()
This method gets the scale parameter of ln(Y).

Returns:
the scale parameter

setScale

public void setScale(double s)
This method sets the scale parameter of ln(Y).

Parameters:
s - the scale parameter

getCDF

public double getCDF(double x)
This method computes the cumulative distribution function.

Overrides:
getCDF in class Distribution
Parameters:
x - a value in the domain of the distribution
Returns:
the cumulative probability at x

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters