clProbDist
An OpenCL library for probability distributions
Typedefs
poisson.h File Reference

API of the Poisson distribution. More...

#include "clProbDist/clProbDist.h"
#include <float.h>

Go to the source code of this file.

Typedefs

typedef struct _clprobdistPoisson clprobdistPoisson
 Poisson distribution object [device]. More...
 

Functions

Functions to create and destroy distribution objects
clprobdistPoissonclprobdistPoissonCreate (cl_double lambda, size_t *bufSize, clprobdistStatus *err)
 Create a distribution object. More...
 
clprobdistStatus clprobdistPoissonDestroy (clprobdistPoisson *dist)
 Destroy a distribution object. More...
 
Functions for use with a distribution object
cl_double clprobdistPoissonProbWithObject (const clprobdistPoisson *dist, cl_int x, clprobdistStatus *err)
 Probability mass function [device]. More...
 
cl_double clprobdistPoissonCDFWithObject (const clprobdistPoisson *dist, cl_int x, clprobdistStatus *err)
 Cumulative density function [device]. More...
 
cl_double clprobdistPoissonComplCDFWithObject (const clprobdistPoisson *dist, cl_int x, clprobdistStatus *err)
 Complementary CDF or reliability function [device]. More...
 
cl_int clprobdistPoissonInverseCDFWithObject (const clprobdistPoisson *dist, cl_double u, clprobdistStatus *err)
 Inverse cumulative density function [device]. More...
 
cl_double clprobdistPoissonMeanWithObject (const clprobdistPoisson *dist, clprobdistStatus *err)
 Mean of the distribution [device]. More...
 
cl_double clprobdistPoissonVarianceWithObject (const clprobdistPoisson *dist, clprobdistStatus *err)
 Variance of the distribution [device]. More...
 
cl_double clprobdistPoissonStdDeviationWithObject (const clprobdistPoisson *dist, clprobdistStatus *err)
 Standard deviation of the distribution [device]. More...
 
cl_double clprobdistPoissonGetLambda (const clprobdistPoisson *dist, clprobdistStatus *err)
 Return the value of the mean \(\lambda\) [device].
 
Functions for use with explicit distribution parameters
cl_double clprobdistPoissonProb (cl_double lambda, cl_int x, clprobdistStatus *err)
 Probability mass function [device]. More...
 
cl_double clprobdistPoissonCDF (cl_double lambda, cl_int x, clprobdistStatus *err)
 Cumulative density function [device]. More...
 
cl_double clprobdistPoissonComplCDF (cl_double lambda, cl_int x, clprobdistStatus *err)
 Complementary CDF or reliability function [device]. More...
 
cl_int clprobdistPoissonInverseCDF (cl_double lambda, cl_double u, clprobdistStatus *err)
 Inverse cumulative density function [device]. More...
 
cl_double clprobdistPoissonMean (cl_double lambda, clprobdistStatus *err)
 Mean of the distribution [device]. More...
 
cl_double clprobdistPoissonVariance (cl_double lambda, clprobdistStatus *err)
 Variance of the distribution [device]. More...
 
cl_double clprobdistPoissonStdDeviation (cl_double lambda, clprobdistStatus *err)
 Standard deviation of the distribution [device]. More...
 

Detailed Description

API of the Poisson distribution.

Implementation of clProbDist_template.h for the Poisson distribution, adapted from [5] .

Typedef Documentation

typedef struct _clprobdistPoisson clprobdistPoisson

Poisson distribution object [device].

A structure that represents a Poisson distribution object.

Function Documentation

clprobdistPoisson* clprobdistPoissonCreate ( cl_double  lambda,
size_t *  bufSize,
clprobdistStatus err 
)

Create a distribution object.

Create a new Poisson distribution object. Since this function allocates memory for the new distribution object; clprobdistDestroy() must be called to release the allocated memory.

Parameters
[in]lambdaValue of the mean \(\lambda\).
[out]bufSizeSize in bytes of the created distribution object, or NULL.
[out]errError status variable, or NULL.
Returns
New distribution object.
Examples:
DocsTutorial/example3.c, and DocsTutorial/example4.c.
clprobdistStatus clprobdistPoissonDestroy ( clprobdistPoisson dist)

Destroy a distribution object.

Release the resources associated to a distribution object.

Parameters
[in,out]distDistribution object.
Returns
Error status.
Examples:
DocsTutorial/example3.c, and DocsTutorial/example4.c.
cl_double clprobdistPoissonProbWithObject ( const clprobdistPoisson dist,
cl_int  x,
clprobdistStatus err 
)

Probability mass function [device].

Return \(p(x)\), the probability of \(x\) associated with the distribution object dist.

This function is defined only for discrete distributions (see Implemented distributions).

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(p(x)\).
cl_double clprobdistPoissonCDFWithObject ( const clprobdistPoisson dist,
cl_int  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.

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(F(x)\).
cl_double clprobdistPoissonComplCDFWithObject ( const clprobdistPoisson dist,
cl_int  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.

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(\bar F(x)\).
Warning
The complementary distribution function is defined as \(\bar F(j) = \mathbb P[X \geq j]\).
cl_int clprobdistPoissonInverseCDFWithObject ( const clprobdistPoisson 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.

Parameters
[in]distDistribution object.
[in]uValue of \(u \in [0,1]\).
[out]errError status variable, or NULL.
Returns
Value of \(F^{-1}(u)\).
cl_double clprobdistPoissonMeanWithObject ( const clprobdistPoisson dist,
clprobdistStatus err 
)

Mean of the distribution [device].

Return the mean of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Mean of the distribution.
cl_double clprobdistPoissonVarianceWithObject ( const clprobdistPoisson dist,
clprobdistStatus err 
)

Variance of the distribution [device].

Return the variance of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Variance of the distribution.
cl_double clprobdistPoissonStdDeviationWithObject ( const clprobdistPoisson dist,
clprobdistStatus err 
)

Standard deviation of the distribution [device].

Return the standard deviation of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Standard deviation of the distribution.
cl_double clprobdistPoissonProb ( cl_double  lambda,
cl_int  x,
clprobdistStatus err 
)

Probability mass function [device].

See also
clprobdistPoissonProbWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(f(x)\).
cl_double clprobdistPoissonCDF ( cl_double  lambda,
cl_int  x,
clprobdistStatus err 
)

Cumulative density function [device].

See also
clprobdistPoissonCDFWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(F(x)\).
cl_double clprobdistPoissonComplCDF ( cl_double  lambda,
cl_int  x,
clprobdistStatus err 
)

Complementary CDF or reliability function [device].

See also
clprobdistPoissonComplCDFWithObject()
Warning
The complementary distribution function is defined as \(\bar F(j) = \mathbb P[X \geq j]\).
Parameters
[in]lambdaValue of the mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(\bar F(x)\).
cl_int clprobdistPoissonInverseCDF ( cl_double  lambda,
cl_double  u,
clprobdistStatus err 
)

Inverse cumulative density function [device].

See also
clprobdistPoissonInverseCDFWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[in]uValue of \(u \in [0,1]\).
[out]errError status variable, or NULL.
Returns
Value of \(F^{-1}(u)\).
cl_double clprobdistPoissonMean ( cl_double  lambda,
clprobdistStatus err 
)

Mean of the distribution [device].

See also
clprobdistPoissonMeanWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Mean of the distribution.
cl_double clprobdistPoissonVariance ( cl_double  lambda,
clprobdistStatus err 
)

Variance of the distribution [device].

See also
clprobdistPoissonVarianceWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Variance of the distribution.
cl_double clprobdistPoissonStdDeviation ( cl_double  lambda,
clprobdistStatus err 
)

Standard deviation of the distribution [device].

See also
clprobdistPoissonStdDeviationWithObject()
Parameters
[in]lambdaValue of the mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Standard deviation of the distribution.