## distributions.Beta


Beta distribution implementation.


Usage

``` python
distributions.Beta(
    alpha1, alpha2, lower_bound=0.0, upper_bound=1.0, random_seed=None
)
```


A flexible continuous probability distribution defined on the interval \[0,1\], which can be rescaled to any arbitrary interval \[min, max\].

As defined in Simulation Modeling and Analysis (Law, 2007).


## Common Uses:

1.  Useful as a rough model in the absence of data
2.  Distribution of a random proportion
3.  Time to complete a task


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize a Beta distribution. |
| [sample()](#sample) | Generate random samples from the Beta distribution. |

------------------------------------------------------------------------


#### \_\_init\_\_()


Initialize a Beta distribution.


Usage

``` python
__init__(alpha1, alpha2, lower_bound=0.0, upper_bound=1.0, random_seed=None)
```


##### Parameters


`alpha1: float`  
First shape parameter. Must be positive.

`alpha2: float`  
Second shape parameter. Must be positive.

`lower_bound: float = ``0.0`  
Lower bound for rescaling the distribution from \[0,1\] to \[lower_bound, upper_bound\].

`upper_bound: float = ``1.0`  
Upper bound for rescaling the distribution from \[0,1\] to \[lower_bound, upper_bound\].

`random_seed: Optional[Union[int, SeedSequence]] = None`  
A random seed or SeedSequence to reproduce samples. If None, a unique sample sequence is generated.


------------------------------------------------------------------------


#### sample()


Generate random samples from the Beta distribution.


Usage

``` python
sample(size=None)
```


##### Parameters


`size: Optional[Union[int, Tuple[int, …]]] = None`  
The number/shape of samples to generate:

- If None: returns a single sample as a float
- If int: returns a 1-D array with that many samples
- If tuple of ints: returns an array with that shape


##### Returns


`Union[float, NDArray[np.float64]]`  
Random samples from the Beta distribution, rescaled to \[min, max\]:

- A single float when size is None
- A numpy array of floats with shape determined by size parameter
