Class DistLogNormalTrunc
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
nl.tudelft.simulation.jstats.distributions.DistLogNormalTrunc
- All Implemented Interfaces:
Serializable
The Truncated Lognormal distribution.
(c) copyright 2020-2021 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from class nl.tudelft.simulation.jstats.distributions.DistNormal
haveNextNextGaussian, mu, sigma
-
Constructor Summary
ConstructorDescriptionDistLogNormalTrunc
(StreamInterface stream, double min, double max) Construct a truncated lognormal distribution with mu=0, sigma=1 with given min and max.DistLogNormalTrunc
(StreamInterface stream, double mu, double sigma, double min, double max) constructs a truncated lognormal distribution with mu and sigma and given min and max. -
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
getMax()
double
getMin()
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
-
DistLogNormalTrunc
Construct a truncated lognormal distribution with mu=0, sigma=1 with given min and max.- Parameters:
stream
- StreamInterface; the random number streammin
- double; minimum x-value of the distributionmax
- double; maximum x-value of the distribution
-
DistLogNormalTrunc
constructs a truncated lognormal distribution with mu and sigma and given min and max.- Parameters:
stream
- StreamInterface; the random number streammu
- double; the meansigma
- double; the standard deviationmin
- double; minimum x-value of the distributionmax
- double; maximum x-value of the distribution
-
-
Method Details
-
draw
public double draw()draws the next stream value according to the probability of this this distribution.- Overrides:
draw
in classDistLogNormal
- Returns:
- the next double value drawn.
-
getCumulativeProbability
public double getCumulativeProbability(double x) returns the cumulative probability of the x-value.- Overrides:
getCumulativeProbability
in classDistLogNormal
- Parameters:
x
- double; the observation x- Returns:
- double the cumulative probability
-
getProbabilityDensity
public double getProbabilityDensity(double x) returns the probability density value of a value x.- Overrides:
getProbabilityDensity
in classDistLogNormal
- Parameters:
x
- double; the value for which the density function needs to be calculated- Returns:
- double; the probability density for value x
-
getInverseCumulativeProbability
public double getInverseCumulativeProbability(double cumulativeProbability) returns the x-value of the given cumulativePropability.- Overrides:
getInverseCumulativeProbability
in classDistLogNormal
- Parameters:
cumulativeProbability
- double; reflects cum prob- Returns:
- double the inverse cumulative probability
-
getMin
public double getMin()- Returns:
- min
-
getMax
public double getMax()- Returns:
- max
-
toString
- Overrides:
toString
in classDistLogNormal
-