Class LogNormalDistribution
- java.lang.Object
-
- elki.math.statistics.distribution.LogNormalDistribution
-
- All Implemented Interfaces:
Distribution
@Alias("lognormal") public class LogNormalDistribution extends java.lang.Object implements Distribution
Log-Normal distribution. The parameterization of this class is somewhere inbetween of GNU R and SciPy. Similar to GNU R we use the logmean and logstddev. Similar to Scipy, we also have a location parameter that shifts the distribution. Our implementation maps to SciPy's as follows: scipy.stats.lognorm(logstddev, shift, FastMath.exp(logmean))- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LogNormalDistribution.Par
Parameterization class-
Nested classes/interfaces inherited from interface elki.math.statistics.distribution.Distribution
Distribution.Parameterizer
-
-
Constructor Summary
Constructors Constructor Description LogNormalDistribution(double logmean, double logstddev, double shift)
Constructor for Log-Normal distribution
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
cdf(double val)
Return the cumulative density function at the given value.static double
cdf(double x, double mu, double sigma)
Cumulative probability density function (CDF) of a normal distribution.double
getLogMean()
Get the log mean value.double
getLogStddev()
Get the log standard deviation.double
getShift()
Get the distribution shift.double
logpdf(double val)
Return the log density of an existing valuestatic double
logpdf(double x, double mu, double sigma)
Probability density function of the normal distribution.double
nextRandom(java.util.Random random)
Generate a new random valuedouble
pdf(double val)
Return the density of an existing valuestatic double
pdf(double x, double mu, double sigma)
Probability density function of the normal distribution.double
quantile(double val)
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.static double
quantile(double x, double mu, double sigma)
Inverse cumulative probability density function (probit) of a normal distribution.java.lang.String
toString()
Describe the distribution
-
-
-
Method Detail
-
getLogMean
public double getLogMean()
Get the log mean value.- Returns:
- logmean
-
getLogStddev
public double getLogStddev()
Get the log standard deviation.- Returns:
- log standard deviation
-
getShift
public double getShift()
Get the distribution shift.- Returns:
- Shift
-
pdf
public double pdf(double val)
Description copied from interface:Distribution
Return the density of an existing value- Specified by:
pdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- distribution density
-
logpdf
public double logpdf(double val)
Description copied from interface:Distribution
Return the log density of an existing value- Specified by:
logpdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- log distribution density
-
cdf
public double cdf(double val)
Description copied from interface:Distribution
Return the cumulative density function at the given value.- Specified by:
cdf
in interfaceDistribution
- Parameters:
val
- existing value- Returns:
- cumulative density
-
quantile
public double quantile(double val)
Description copied from interface:Distribution
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.- Specified by:
quantile
in interfaceDistribution
- Parameters:
val
- Quantile to find- Returns:
- Quantile position
-
pdf
public static double pdf(double x, double mu, double sigma)
Probability density function of the normal distribution.1/(SQRT(2*pi)*sigma*x) * e^(-log(x-mu)^2/2sigma^2)
- Parameters:
x
- The value.mu
- The mean.sigma
- The standard deviation.- Returns:
- PDF of the given normal distribution at x.
-
logpdf
public static double logpdf(double x, double mu, double sigma)
Probability density function of the normal distribution.1/(SQRT(2*pi)*sigma*x) * e^(-log(x-mu)^2/2sigma^2)
- Parameters:
x
- The value.mu
- The mean.sigma
- The standard deviation.- Returns:
- logPDF of the given normal distribution at x.
-
cdf
public static double cdf(double x, double mu, double sigma)
Cumulative probability density function (CDF) of a normal distribution.- Parameters:
x
- value to evaluate CDF atmu
- Mean valuesigma
- Standard deviation.- Returns:
- The CDF of the given normal distribution at x.
-
quantile
public static double quantile(double x, double mu, double sigma)
Inverse cumulative probability density function (probit) of a normal distribution.- Parameters:
x
- value to evaluate probit function atmu
- Mean valuesigma
- Standard deviation.- Returns:
- The probit of the given normal distribution at x.
-
nextRandom
public double nextRandom(java.util.Random random)
Description copied from interface:Distribution
Generate a new random value- Specified by:
nextRandom
in interfaceDistribution
- Parameters:
random
- Random number generator- Returns:
- new random value
-
toString
public java.lang.String toString()
Description copied from interface:Distribution
Describe the distribution- Specified by:
toString
in interfaceDistribution
- Overrides:
toString
in classjava.lang.Object
- Returns:
- description
-
-