DistLogNormal

class pydsol.core.distributions.DistLogNormal(stream: StreamInterface, mu: float = 0.0, sigma: float = 1.0)[source]

Bases: DistNormal

The LogNormal distribution for random variable X is such that ln(X) ~ Normal(mu, sigma). For more information on this distribution see https://mathworld.wolfram.com/LogNormalDistribution.html.

__init__(stream: StreamInterface, mu: float = 0.0, sigma: float = 1.0)[source]

Constructs a new LogNormal distribution, with two parameters: mu for the mean of the underlying Normal distribution, and sigma for the standard deviation of the underlying Normal distribution. The LogNormal distribution is a continuous distribution that yields positive values. The LogNormal distribution for random variable X is such that ln(X) ~ Normal(mu, sigma).

Parameters:
  • stream (StreamInterface) – the random stream to use for this distribution

  • mu (float or int) – the mean of the underlying Normal distribution

  • sigma (float or int) – the standard deviation of the underlying Normal distribution

Raises:
  • TypeError – when stream is not implementing StreamInterface:

  • TypeError – when mu or sigma is not a float or int:

  • ValueError – when sigma <= 0:

draw() float[source]

Draw a value from the LogNormal distribution with mean mu and standard deviation sigma for the underlying Normal distribution.

probability_density(x: float) float[source]

Returns the probability density value for value x.

cumulative_probability(x: float) float[source]

Return the cumulative probability of x for this LogNormal distribution

inverse_cumulative_probability(y: float) float[source]

Return the x-value of the given cumulative probability y.

property mu: float

Return the parameter value mu, note that this is the mean of the underlying Normal distribution

property sigma: float

Return the parameter value sigma, note that this is the standard deviation of the underlying Normal distribution

property stream: StreamInterface

Return the current random stream for this distribution.