Distribution from Weighted Samples
Name
UxHwDoubleDistFromWeightedSamples, UxHwFloatDistFromWeightedSamples — Create a distributional value from an array of weighted samples.
Synopsis
#include <stddef.h>
#include <uxhw.h>
double UxHwDoubleDistFromWeightedSamples(WeightedDoubleSample * samples, size_t weightedSampleCount);
float UxHwFloatDistFromWeightedSamples(WeightedFloatSample * samples, size_t weightedSampleCount);
Description
The UxHwDoubleDistFromWeightedSamples() function returns a floating-point value which is the mean of a distribution based on weighted samples from samples array.
Weighted samples is a collection of samples and corresponding weights. Weights can be arbitrary non-negative floating-point values representing
the relative frequency of samples.
On architectures that associate distributional information with floating-point values, UxHwDoubleDistFromWeightedSamples() creates a distributional value that follows the empirical distribution of the first weightedSampleCount elements of the array samples.
On such architectures, the return value is associated, at the architecture level, with the distributional value created and it is equal to the mean of the distribution.