Class DistLogNormal
java.lang.Object
nl.tudelft.simulation.jstats.distributions.Dist
nl.tudelft.simulation.jstats.distributions.DistContinuous
nl.tudelft.simulation.jstats.distributions.DistNormal
nl.tudelft.simulation.jstats.distributions.DistLogNormal
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DistLogNormalTrunc
The LogNormal distribution. For more information on this distribution see
https://mathworld.wolfram.com/LogNormalDistribution.html
The LogNormal distribution for random variable X is such that ln(X) ~ Normal(mu, sigma).
The LogNormal distribution for random variable X is such that ln(X) ~ Normal(mu, sigma).
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from class nl.tudelft.simulation.jstats.distributions.DistNormal
haveNextNextGaussian, mu, sigma
-
Constructor Summary
ConstructorDescriptionDistLogNormal
(StreamInterface stream, double normalMean, double normalStDev) Construct a new Lognormal distribution. -
Method Summary
Modifier and TypeMethodDescriptiondouble
draw()
draws the next stream value according to the probability of this this distribution.double
getCumulativeProbability
(double x) returns the cumulative probability of the x-value.double
getInverseCumulativeProbability
(double cumulativeProbability) returns the x-value of the given cumulativePropability.double
getProbabilityDensity
(double x) returns the probability density value of a value x.toString()
Methods inherited from class nl.tudelft.simulation.jstats.distributions.DistNormal
getMu, getSigma, nextGaussian, setStream
-
Constructor Details
-
DistLogNormal
Construct a new Lognormal distribution. The LogNormal distribution for random variable X is such that ln(X) ~ Normal(mu, sigma).- Parameters:
stream
- StreamInterface; the random number streamnormalMean
- double; the mean (mu) for the underlying normal distributionnormalStDev
- double; the standard deviation (sigma) for the underlying normal distribution- Throws:
IllegalArgumentException
- when normalStDev <= 0
-
-
Method Details
-
draw
public double draw()draws the next stream value according to the probability of this this distribution.- Overrides:
draw
in classDistNormal
- Returns:
- the next double value drawn.
-
getProbabilityDensity
public double getProbabilityDensity(double x) returns the probability density value of a value x.- Overrides:
getProbabilityDensity
in classDistNormal
- Parameters:
x
- double; the value for which the density function needs to be calculated- Returns:
- double; the probability density for value x
-
getCumulativeProbability
public double getCumulativeProbability(double x) returns the cumulative probability of the x-value.- Overrides:
getCumulativeProbability
in classDistNormal
- Parameters:
x
- double; the observation x- Returns:
- double the cumulative probability
-
getInverseCumulativeProbability
public double getInverseCumulativeProbability(double cumulativeProbability) returns the x-value of the given cumulativePropability.- Overrides:
getInverseCumulativeProbability
in classDistNormal
- Parameters:
cumulativeProbability
- double; reflects cum prob- Returns:
- double the inverse cumulative probability
-
toString
- Overrides:
toString
in classDistNormal
-