DistPearson5

class pydsol.core.distributions.DistPearson5(stream: StreamInterface, alpha: float, beta: float)[source]

Bases: DistContinuous

The Pearson5 distribution with a shape parameter alpha and a scale parameter beta. The distribution is sometimes called the inverse gamma distribution, because if X ~ PT5(alpha, beta) if and only if Y = 1 / X ~ gamma(alpha, 1/beta). For more information on this distribution see https://en.wikipedia.org/wiki/Inverse-gamma_distribution.

__init__(stream: StreamInterface, alpha: float, beta: float)[source]

The Pearson5 distribution with a shape parameter alpha and a scale parameter beta. The distribution is sometimes called the inverse gamma distribution, because if X ~ PT5(alpha, beta) if and only if Y = 1 / X ~ gamma(alpha, 1/beta).

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

  • alpha (float) – the shape parameter of the Pearson5 distribution

  • beta (float) – the scale parameter of the Pearson5 distribution

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

  • TypeError – when alpha is not a float or int:

  • TypeError – when beta is not a float or int:

  • ValueError – when alpha <= 0 or beta <= 0:

draw() float[source]

Draw a value from the Pearson5 distribution. Based on the algorithm in Law & Kelton, Simulation Modeling and Analysis, 1991, p. 492-493.

probability_density(x: float) float[source]

Returns the probability density value for value x.

property alpha: float

Return the parameter value alpha

property beta: int

Return the parameter value beta

property stream: StreamInterface

Return the current random stream for this distribution.