public class LogNormalVariate extends NormalVariate
Generates random variates from the Log Normal(μ, σ) distribution based on the exponential transformation of a Normal. Note that the parameters μ and σ are the corresponding Normal parameters and not the mean and standard deviation of the distribution itself.
Two convenience static methods are provided to transform a desired mean and standard deviation into the corresponding Normal parameters, as well as the inverse, to transform a given mean and standard deviation for the normal into the actual mean and standard deviation for the distribution.
rng
Constructor and Description |
---|
LogNormalVariate() |
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generates the next Log Normal random variate
|
static double[] |
getLogNormalParameters(double mean,
double stdDeviation)
A convenience method to convert the underlying Normal parameters into the
actual mean and standard deviation for the log normal distribution.
|
static double[] |
getNormalParameters(double mean,
double stdDeviation)
Convenience method to convert a given desired mean and standard deviation
into the corresponding Normal mean and standard deviation.
|
java.lang.String |
toString()
Returns the name and parameters of the distribution
|
getMean, getParameters, getStandardDeviation, getVariance, setMean, setParameters, setStandardDeviation
getRandomNumber, setRandomNumber
public double generate()
generate
in interface RandomVariate
generate
in class NormalVariate
public static double[] getNormalParameters(double mean, double stdDeviation)
mean
- The mean of the log normal distributionstdDeviation
- The standard deviation of the log normal distributionjava.lang.IllegalArgumentException
- if mean < 0.0public static double[] getLogNormalParameters(double mean, double stdDeviation)
mean
- The mean of the underlying NormalstdDeviation
- The standard deviation of the underlying Normalpublic java.lang.String toString()
toString
in class NormalVariate