clProbDist
An OpenCL library for probability distributions
|
API of the gamma distribution. More...
Go to the source code of this file.
Typedefs | |
typedef struct _clprobdistGamma | clprobdistGamma |
Gamma distribution object [device]. More... | |
Functions | |
Functions to create and destroy distribution objects | |
clprobdistGamma * | clprobdistGammaCreate (cl_double alpha, cl_double lambda, int decprec, size_t *bufSize, clprobdistStatus *err) |
Create a distribution object. More... | |
clprobdistStatus | clprobdistGammaDestroy (clprobdistGamma *dist) |
Destroy a distribution object. More... | |
Functions for use with explicit distribution parameters | |
cl_double | clprobdistGammaDensityWithObject (const clprobdistGamma *dist, cl_double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
cl_double | clprobdistGammaCDFWithObject (const clprobdistGamma *dist, cl_double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
cl_double | clprobdistGammaComplCDFWithObject (const clprobdistGamma *dist, cl_double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
cl_double | clprobdistGammaInverseCDFWithObject (const clprobdistGamma *dist, cl_double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
cl_double | clprobdistGammaMeanWithObject (const clprobdistGamma *dist, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
cl_double | clprobdistGammaVarianceWithObject (const clprobdistGamma *dist, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
cl_double | clprobdistGammaStdDeviationWithObject (const clprobdistGamma *dist, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
cl_double | clprobdistGammaGetAlpha (const clprobdistGamma *dist, clprobdistStatus *err) |
Return the shape parameter of the distribution [device]. More... | |
cl_double | clprobdistGammaGetLambda (const clprobdistGamma *dist, clprobdistStatus *err) |
Return the scale parameter of the distribution [device]. More... | |
cl_double | clprobdistGammaDensity (cl_double alpha, cl_double lambda, int decprec, cl_double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
cl_double | clprobdistGammaCDF (cl_double alpha, cl_double lambda, int decprec, cl_double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
cl_double | clprobdistGammaComplCDF (cl_double alpha, cl_double lambda, int decprec, cl_double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
cl_double | clprobdistGammaInverseCDF (cl_double alpha, cl_double lambda, int decprec, cl_double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
cl_double | clprobdistGammaMean (cl_double alpha, cl_double lambda, int decprec, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
cl_double | clprobdistGammaVariance (cl_double alpha, cl_double lambda, int decprec, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
cl_double | clprobdistGammaStdDeviation (cl_double alpha, cl_double lambda, int decprec, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
API of the gamma distribution.
Implementation of clProbDist_template.h for the gamma distribution, adapted from [5] .
For the sake of uniformity, all functions of the gamma distribution API that take explicit distribution parameters as their first arguments, instead of a distribution object, also include an integer decprec
argument, documented in Implemented distributions. Some of them actually use the argument value, others just ignore it. This is indicated in the individual descriptions of these functions.
typedef struct _clprobdistGamma clprobdistGamma |
Gamma distribution object [device].
A structure that represents a gamma distribution object.
clprobdistGamma* clprobdistGammaCreate | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
size_t * | bufSize, | ||
clprobdistStatus * | err | ||
) |
Create a distribution object.
Create a new gamma distribution object. Since this function allocates memory for the new distribution object; clprobdistDestroy() must be called to release the allocated memory.
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[out] | bufSize | Size in bytes of the created distribution object, or NULL . |
[out] | err | Error status variable, or NULL . |
clprobdistStatus clprobdistGammaDestroy | ( | clprobdistGamma * | dist | ) |
Destroy a distribution object.
Release the resources associated to a distribution object.
[in,out] | dist | Distribution object. |
cl_double clprobdistGammaDensityWithObject | ( | const clprobdistGamma * | dist, |
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
Return \(f(x)\), the value at \(x=\)x
of the probability density function associated with the distribution object dist
.
This function is defined only for continuous distributions (see Implemented distributions).
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaCDFWithObject | ( | const clprobdistGamma * | dist, |
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
Return \(F(x)\), the value at \(x=\)x
of the distribution function associated with the distribution object dist
.
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaComplCDFWithObject | ( | const clprobdistGamma * | dist, |
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
Return \(\bar F(x)\), the value of the complementary distribution function associated with the distribution object dist
.
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaInverseCDFWithObject | ( | const clprobdistGamma * | dist, |
cl_double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
Return \(F^{-1}(u)\), the value at \(u=\)u
of the inverse distribution function associated with the distribution object dist
. The type of the return value is cl_int
for a discrete distribution of cl_double
for a continuous distribution.
[in] | dist | Distribution object. |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaMeanWithObject | ( | const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
Return the mean of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaVarianceWithObject | ( | const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
Return the variance of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaStdDeviationWithObject | ( | const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
Return the standard deviation of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaGetAlpha | ( | const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Return the shape parameter of the distribution [device].
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaGetLambda | ( | const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Return the scale parameter of the distribution [device].
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaDensity | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaCDF | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaComplCDF | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaInverseCDF | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
cl_double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaMean | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaVariance | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistGammaStdDeviation | ( | cl_double | alpha, |
cl_double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |