DistBeta
- class pydsol.core.distributions.DistBeta(stream: StreamInterface, alpha1: float, alpha2: float)[source]
Bases:
DistContinuous
The Beta distribution is a continuous distribution that is bound between 0 and 1 for the outcome, and has two shape parameters alpha 1 and alpha2. For informattion see https://mathworld.wolfram.com/BetaDistribution.html
- __init__(stream: StreamInterface, alpha1: float, alpha2: float)[source]
Constructs a new Beta distribution, with two shape parameters alpha1 and alpha2. The Beta distribution is a continuous distribution and will return a number between 0 and 1 as the result.
- Parameters:
stream (StreamInterface) – the random stream to use for this distribution
alpha1 (float or int) – the first shape parameter
alpha2 (float or int) – the second shape parameter
- Raises:
TypeError – when stream is not implementing StreamInterface:
TypeError – when alpha1 or alpha2 is not a float or int:
ValueError – when alpha1 <= 0 or alpha2 <= 0:
- draw() float [source]
Draw a value from the Beta distribution. Based on the algorithm in Law & Kelton, Simulation Modeling and Analysis, 1991, pages 492-493.
- property alpha1: float
Return the parameter value alpha1
- property alpha2: float
Return the parameter value alpha2
- property stream: StreamInterface
Return the current random stream for this distribution.