DistNormal

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

Bases: DistContinuous

The Normal distribution is a continuous distribution that plays an important role in statistics. When adding (samples from) one or more distributions, the distribution of the sum and of the sample average becomes normally distributed as a result of the Central Limit Theorem. Still, the Normal distribution is not used often in (discrete event) simulation because it is unbounded and can return negative values. Therefore, its use for processing times and inter-arrival times, but even something like a length, should be discouraged. Instead, distributions like Exponential, Gamma, Erlang, Pearson, or Weibull (bounded by 0 – always positive) or Triangular, Uniform or Beta (bounded by a minimum and maximum value) are to be preferred.

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

Constructs a new Normal distribution, with two parameters mu for the mean, and sigma for the standard deviation. The Normal distribution is a continuous distribution and will return a number between minus infinity and infinity as the result. When the parameters are not specified, the so-called standard-normal distribution is created, with mu equal to 0.0, and sigma equal to 1.0.

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

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

  • sigma (float or int) – the standard deviation of the 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 Normal distribution with mean mu and standard deviation sigma.

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 Normal 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, the mean of the Normal distribution

property sigma: float

Return the parameter value sigma, the standard deviation of the Normal distribution

property stream: StreamInterface

Return the current random stream for this distribution.