Beta Distribution
Name
UxHwDoubleBetaDist
, UxHwFloatBetaDist
— Create a Beta distribution.
Synopsis
#include <uxhw.h>
double UxHwDoubleBetaDist(double a, double b);
float UxHwFloatBetaDist(float a, float b);
Description
The UxHwDoubleBetaDist()
function, on architectures that associate distributional information with floating-point values, creates a Beta distribution with parameters a
and b
and associates it with its return value. The particle return value is the mean value of a Beta distribution with parameters a
and b
. The probability density function of the Beta distribution is
where is the Beta function and is the Gamma function.
Parameters
a
— The shape parameter () of the Beta distribution.b
— The shape parameter () of the Beta distribution.
Return Values
The UxHwDoubleBetaDist()
function returns the mean of samples of a Beta distribution with parameter a
and b
.
If a <= 0
or b <= 0
, the function returns NaN
.
✏️ Examples
#include <stdio.h>
#include <uxhw.h>
int
main(void)
{
double value = UxHwDoubleBetaDist(1.0,2.0);
printf("value = %lf\n", value);
return 0;
}