[#absl-beta_distribution] = xref:absl.adoc[absl]::beta_distribution :relfileprefix: ../ :mrdocs: 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. == Synopsis Declared in `<absl/random/beta_distribution.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename RealType = double> class beta_distribution; ---- == Description 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. == Types [cols="1,4"] |=== | Name| Description | xref:absl/beta_distribution/param_type.adoc[`param_type`] | The parameter set of the distribution. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:absl/beta_distribution/result_type.adoc[`result_type`] | The type of the values produced by the distribution. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/beta_distribution/2constructor-0a.adoc[`beta_distribution`] [.small]#[constructor]# | Constructors | xref:absl/beta_distribution/alpha.adoc[`alpha`] | Returns the first shape parameter. | xref:absl/beta_distribution/beta.adoc[`beta`] | Returns the second shape parameter. | xref:absl/beta_distribution/max.adoc[`max`] | Returns the largest value the distribution can produce. | xref:absl/beta_distribution/min.adoc[`min`] | Returns the smallest value the distribution can produce. | xref:absl/beta_distribution/operator_call-0a.adoc[`operator()`] | Function call operators | xref:absl/beta_distribution/param-04.adoc[`param`] | `param` overloads | xref:absl/beta_distribution/reset.adoc[`reset`] | Resets the internal state of the distribution. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:absl/operator_not_eq-0b8.adoc[absl::operator!=]` | Compares two distributions for inequality. | `xref:absl/operator_eq-0af.adoc[absl::operator==]` | Compares two distributions for equality. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#