public class LogNormalDistribution extends Object implements ProbabilityDistribution
The constructor takes the mean and standard deviation of the natural logarithm, not of the original measurements. The median in original units is the exponential of the log mean.
import dev.nm.stat.distribution.univariate.LogNormalDistribution;
LogNormalDistribution positive = new LogNormalDistribution(Math.log(2), 0.5);
assert Math.abs(positive.median() - 2.0) < 1e-12;
assert Math.abs(positive.cdf(2.0) - 0.5) < 1e-12;
assert Math.abs(positive.quantile(0.5) - 2.0) < 1e-12;
| Constructor and Description |
|---|
LogNormalDistribution(double logMu,
double logSigma)
Construct a log-normal distribution.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cdf(double x)
Gets the cumulative probability F(x) = Pr(X ≤ x).
|
double |
density(double x)
The density function, which, if exists, is the derivative of F.
|
double |
entropy()
Gets the entropy of this distribution.
|
double |
kurtosis()
Gets the excess kurtosis of this distribution.
|
double |
mean()
Gets the mean of this distribution.
|
double |
median()
Gets the median of this distribution.
|
double |
moment(double s)
The moment generating function is the expected value of \(e^{tX}\).
|
double |
quantile(double u)
Gets the quantile, the inverse of the cumulative distribution function.
|
double |
skew()
Gets the skewness of this distribution.
|
double |
variance()
Gets the variance of this distribution.
|
public LogNormalDistribution(double logMu,
double logSigma)
logMu - the log meanlogSigma - the log standard deviationpublic double mean()
ProbabilityDistributionmean in interface ProbabilityDistributionpublic double median()
ProbabilityDistributionmedian in interface ProbabilityDistributionpublic double variance()
ProbabilityDistributionvariance in interface ProbabilityDistributionpublic double skew()
ProbabilityDistributionskew in interface ProbabilityDistributionpublic double kurtosis()
ProbabilityDistributionkurtosis in interface ProbabilityDistributionpublic double entropy()
ProbabilityDistributionentropy in interface ProbabilityDistributionpublic double cdf(double x)
ProbabilityDistributioncdf in interface ProbabilityDistributionx - xpublic double quantile(double u)
ProbabilityDistributionquantile in interface ProbabilityDistributionu - u, a quantilepublic double density(double x)
ProbabilityDistributiondensity in interface ProbabilityDistributionx - xpublic double moment(double s)
ProbabilityDistributionmoment in interface ProbabilityDistributions - tCopyright © 2010-2026 NM Group. All Rights Reserved.