ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This module contains classes and procedures for computing various statistical quantities related to the Beta distribution. More...
Data Types | |
type | distBeta_type |
This is the derived type for signifying distributions that are of type Beta as defined in the description of pm_distBeta. More... | |
interface | getBetaCDF |
Generate and return the CDF of the Beta distribution for the given parameters \((\alpha, \beta)\) as defined in the details section of pm_distBeta. More... | |
interface | getBetaLogPDF |
Generate and return the natural logarithm of the Probability Density Function (PDF) of the Beta distribution for an input x within the support of the distribution \(x \in (0,1)\). More... | |
interface | getBetaPDF |
Generate and return the Probability Density Function (PDF) of the Beta distribution for an input x within the support of the distribution \(x \in [0,1]\). More... | |
interface | setBetaCDF |
Return the CDF of the Beta distribution for the given parameters \((\alpha, \beta)\) as defined in the details section of pm_distBeta. More... | |
interface | setBetaLogPDF |
Return the natural logarithm of the Probability Density Function (PDF) of the Beta distribution for an input x within the support of the distribution \(x \in (0,1)\). More... | |
interface | setBetaRand |
Return a scalar or array of arbitrary rank of Beta-distributed random values in range \([0, 1]\) (or \((0, 1)\), depending on the specific parameter values) with the specified two shape parameters \((\alpha, \beta)\) of the Beta distribution corresponding to the procedure arguments (alpha, beta) . More... | |
Variables | |
character(*, SK), parameter | MODULE_NAME = "@pm_distBeta" |
This module contains classes and procedures for computing various statistical quantities related to the Beta distribution.
Specifically, this module contains routines for computing the following quantities of the Beta distribution:
The PDF of the Beta distribution is defined with two shape parameters \((\alpha > 0, \beta > 0)\) as,
\begin{equation} \large \pi(x | \alpha, \beta) = \begin{cases} \frac {x^{\alpha - 1} (1 - x)^{\beta - 1}} {\mathrm{B}(\alpha, \beta)} &,~ x \in (0, 1) ~, \\ 0 &,~ x \notin (0,1) ~. \end{cases} \end{equation}
where,
\begin{equation} \mathrm{B}(\alpha, \beta) = \frac {\Gamma(\alpha) \Gamma(\beta)} {\Gamma(\alpha + \beta)} \end{equation}
is the Beta function whose natural logarithm is returned by getLogBeta.
Note that the common definitions of the Beta distribution consider the end points \( x = 0, x = 1\) also as part of the support of the distribution.
But this inclusion is valid only if the condition \((\alpha \geq 1, \beta \geq 1)\) holds.
Furthermore, the end points correspond to a PDF value of either \(0\) or \(+\infty\), yielding a NaN
when the natural logarithm of the PDF is returned in numerical algorithms.
As such, the support of the Beta distribution in this module is always taken to be the open-interval \(x \in (0,1)\).
The CDF of the Beta distribution is exactly given by the regularized incomplete Beta function.
See the documentation of pm_mathBeta for details of the CDF of the Beta distribution.
Random Number Generation
If \(X\) and \(Y\) are independent, with \(X \sim \Gamma(\alpha, \theta)\) and \(Y \sim \Gamma(\beta, \theta)\) then,
\begin{equation} \frac{X}{X + Y} \sim \mathrm{B}(\alpha, \beta) ~, \end{equation}
where \((\alpha, \beta)\) are the parameters of the target Beta distribution and, \(\theta\) is an arbitrary parameter of the Gamma distribution.
So one algorithm for generating random Beta variates is to generate \(\frac{X}{X + Y}\), where \(X\) is a Gamma variate with parameters \((\alpha, 1)\) and, \(Y\) is an independent gamma variate with parameters \((\beta, 1)\).
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
character(*, SK), parameter pm_distBeta::MODULE_NAME = "@pm_distBeta" |
Definition at line 107 of file pm_distBeta.F90.