Quantile
Name
UxHwDoubleQuantile
, UxHwFloatQuantile
— Return the quantile of a distribution for a given probability value.
Synopsis
#include <uxhw.h>
double UxHwDoubleQuantile(double value, double probability);
float UxHwFloatQuantile(float value, float probability);
Description
On architectures that associate distributional information with floating-point values, the UxHwDoubleQuantile()
function returns the
value of the support position of the distribution associated with value
for which the cumulative distribution function (CDF) equals to probability
.
Parameters
value
— The distributional value to calculate the quantile for.probability
— The probability value used to calculate the quantile forvalue
.
Return Values
The UxHwDoubleQuantile()
function returns a floating-point value equal to the domain position of the distribution value
at which its CDF takes the value probability
.
If value
has no distribution associated with it, it returns value
for any permissible value of probability
.
✏️ Examples
#include <stdio.h>
#include <uxhw.h>
int
main(void)
{
double probability = 0.9;
double a = UxHwDoubleGaussDist(0.0, 1.0);
double quantile = UxHwDoubleQuantile(a, probability);
printf("The %lf quantile of `a` is %lf\n", probability, quantile);
return 0;
}