clProbDist
An OpenCL library for probability distributions
|
API of the lognormal distribution. More...
Go to the source code of this file.
Typedefs | |
typedef struct _clprobdistlLognormal | clprobdistLognormal |
Lognormal distribution object [device]. More... | |
Functions | |
Functions to create and destroy distribution objects | |
clprobdistLognormal * | clprobdistLognormalCreate (cl_double mu, cl_double sigma, size_t *bufSize, clprobdistStatus *err) |
Create a distribution object. More... | |
clprobdistStatus | clprobdistLognormalDestroy (clprobdistLognormal *dist) |
Destroy a distribution object. More... | |
Functions for use with a distribution object | |
cl_double | clprobdistLognormalDensityWithObject (const clprobdistLognormal *dist, cl_double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
cl_double | clprobdistLognormalCDFWithObject (const clprobdistLognormal *dist, cl_double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
cl_double | clprobdistLognormalComplCDFWithObject (const clprobdistLognormal *dist, cl_double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
cl_double | clprobdistLognormalInverseCDFWithObject (const clprobdistLognormal *dist, cl_double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
cl_double | clprobdistLognormalMeanWithObject (const clprobdistLognormal *dist, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
cl_double | clprobdistLognormalVarianceWithObject (const clprobdistLognormal *dist, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
cl_double | clprobdistLognormalStdDeviationWithObject (const clprobdistLognormal *dist, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
cl_double | clprobdistLognormalGetMu (const clprobdistLognormal *dist, clprobdistStatus *err) |
Return the scale parameter. More... | |
cl_double | clprobdistLognormalGetSigma (const clprobdistLognormal *dist, clprobdistStatus *err) |
Return the shape parameter. More... | |
Functions for use with explicit distribution parameters | |
cl_double | clprobdistLognormalDensity (cl_double mu, cl_double sigma, cl_double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
cl_double | clprobdistLognormalCDF (cl_double mu, cl_double sigma, cl_double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
cl_double | clprobdistLognormalComplCDF (cl_double mu, cl_double sigma, cl_double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
cl_double | clprobdistLognormalInverseCDF (cl_double mu, cl_double sigma, cl_double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
cl_double | clprobdistLognormalMean (cl_double mu, cl_double sigma, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
cl_double | clprobdistLognormalVariance (cl_double mu, cl_double sigma, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
cl_double | clprobdistLognormalStdDeviation (cl_double mu, cl_double sigma, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
API of the lognormal distribution.
Implementation of clProbDist_template.h for the lognormal distribution, adapted from [5] .
typedef struct _clprobdistlLognormal clprobdistLognormal |
Lognormal distribution object [device].
A structure that represents a lognormal distribution object.
clprobdistLognormal* clprobdistLognormalCreate | ( | cl_double | mu, |
cl_double | sigma, | ||
size_t * | bufSize, | ||
clprobdistStatus * | err | ||
) |
Create a distribution object.
Create a new lognormal distribution object. Since this function allocates memory for the new distribution object; clprobdistDestroy() must be called to release the allocated memory.
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[out] | bufSize | Size in bytes of the created distribution object, or NULL . |
[out] | err | Error status variable, or NULL . |
clprobdistStatus clprobdistLognormalDestroy | ( | clprobdistLognormal * | dist | ) |
Destroy a distribution object.
Release the resources associated to a distribution object.
[in,out] | dist | Distribution object. |
cl_double clprobdistLognormalDensityWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalCDFWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalComplCDFWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalInverseCDFWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalMeanWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalVarianceWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalStdDeviationWithObject | ( | const clprobdistLognormal * | 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 clprobdistLognormalGetMu | ( | const clprobdistLognormal * | dist, |
clprobdistStatus * | err | ||
) |
Return the scale parameter.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalGetSigma | ( | const clprobdistLognormal * | dist, |
clprobdistStatus * | err | ||
) |
Return the shape parameter.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalDensity | ( | cl_double | mu, |
cl_double | sigma, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalCDF | ( | cl_double | mu, |
cl_double | sigma, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalComplCDF | ( | cl_double | mu, |
cl_double | sigma, | ||
cl_double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalInverseCDF | ( | cl_double | mu, |
cl_double | sigma, | ||
cl_double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalMean | ( | cl_double | mu, |
cl_double | sigma, | ||
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalVariance | ( | cl_double | mu, |
cl_double | sigma, | ||
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[out] | err | Error status variable, or NULL . |
cl_double clprobdistLognormalStdDeviation | ( | cl_double | mu, |
cl_double | sigma, | ||
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
[in] | mu | Value of the scale parameter \(\mu\). |
[in] | sigma | Value of the shape parameter \(\sigma\). |
[out] | err | Error status variable, or NULL . |