Generates a floating-point variate conforming to a Beta distribution: pdf(x) propto x^(alpha-1) * (1-x)^(beta-1), where the params alpha and beta are both strictly positive real values.
Declared in <absl/random/beta_distribution.h>
template<typename RealType = double>
class beta_distribution;
The support is the open interval (0, 1), but the return value might be equal to 0 or 1, due to numerical errors when alpha and beta are very different.
Usage note: One usage is that alpha and beta are counts of number of successes and failures. When the total number of trials are large, consider approximating a beta distribution with a Gaussian distribution with the same mean and variance. One could use the skewness, which depends only on the smaller of alpha and beta when the number of trials are sufficiently large, to quantify how far a beta distribution is from the normal distribution.
| Name | Description |
|---|---|
param_type | The parameter set of the distribution. |
| Name | Description |
|---|---|
result_type | The type of the values produced by the distribution. |
| Name | Description |
|---|---|
beta_distribution [constructor] | Constructors |
alpha | Returns the first shape parameter. |
beta | Returns the second shape parameter. |
max | Returns the largest value the distribution can produce. |
min | Returns the smallest value the distribution can produce. |
operator() | Function call operators |
param | param overloads |
reset | Resets the internal state of the distribution. |
| Name | Description |
|---|---|
absl::operator!= | Compares two distributions for inequality. |
absl::operator== | Compares two distributions for equality. |