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