JWS C Library
C language utility library
pdf.h File Reference

Declarations for univariate probability density functions. More...

#include <jwsc/config.h>
#include <stdlib.h>
Include dependency graph for pdf.h:

Go to the source code of this file.

Functions

standard_gaussian_pdf

Computes the univariate standard Gaussian pdf at a point.

float standard_gaussian_pdf_f (float x)
 Computes the single precision univariate standard Gaussian pdf at a point.
double standard_gaussian_pdf_d (double x)
 Computes the double precision univariate standard Gaussian pdf at a point.
gaussian_pdf

Computes the univariate Gaussian pdf at a point.

float gaussian_pdf_f (float mu, float sigma, float x)
 Computes the single precision univariate Gaussian pdf at a point.
double gaussian_pdf_d (double mu, double sigma, double x)
 Computes the double precision univariate Gaussian pdf at a point.
log_standard_gaussian_pdf

Computes the log of the univariate standard Gaussian pdf at a point.

float log_standard_gaussian_pdf_f (float x)
 Computes the single precision log of the univariate standard Gaussian pdf at a point.
double log_standard_gaussian_pdf_d (double x)
 Computes the double precision log of the univariate standard Gaussian pdf at a point.
log_gaussian_pdf

Computes the log of the univariate Gaussian pdf at a point.

float log_gaussian_pdf_f (float mu, float sigma, float x)
 Computes the single precision log of the univariate Gaussian pdf at a point.
double log_gaussian_pdf_d (double mu, double sigma, double x)
 Computes the double precision log of the univariate Gaussian pdf at a point.
sample_standard_gaussian_pdf

Draws a random sample from the standard Gaussian pdf.

float sample_standard_gaussian_pdf_f (float a, float b)
 Draws a single precision random sample from the standard Gaussian pdf.
double sample_standard_gaussian_pdf_d (double a, double b)
 Draws a double precision random sample from the standard Gaussian pdf.
sample_gaussian_pdf

Draws a random sample from the Gaussian pdf.

float sample_gaussian_pdf_f (float mu, float sigma, float a, float b)
 Draws a single precision random sample from the Gaussian pdf.
double sample_gaussian_pdf_d (double mu, double sigma, double a, double b)
 Draws a double precision random sample from the Gaussian pdf.
sample_uniform_pdf

Draws a random sample from the Uniform pdf.

float sample_uniform_pdf_f (float a, float b)
 Draws a single precision random sample from the Uniform pdf.
double sample_uniform_pdf_d (double a, double b)
 Draws a double precision random sample from the Uniform pdf.
sample_sine_pdf

Draws a random sample from the Sine pdf over the interval [0,PI/2].

float sample_sine_pdf_f ()
 Draws a single precision random sample from the Sine pdf over the interval [0,PI/2].
double sample_sine_pdf_d ()
 Draws a double precision random sample from the Sine pdf over the interval [0.PI/2].

Detailed Description

Declarations for univariate probability density functions.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file pdf.h.


Function Documentation

float standard_gaussian_pdf_f ( float  x)

Computes the single precision univariate standard Gaussian pdf at a point.

Uses mean zero and variance one.

Parameters:
xPoint to evaluate the pdf at.
Returns:
Density of the standard Gaussian at x.

Definition at line 92 of file pdf.c.

double standard_gaussian_pdf_d ( double  x)

Computes the double precision univariate standard Gaussian pdf at a point.

Parameters:
xPoint to evaluate the pdf at.
Returns:
Density of the standard Gaussian at x.

Definition at line 102 of file pdf.c.

float gaussian_pdf_f ( float  mu,
float  sigma,
float  x 
)

Computes the single precision univariate Gaussian pdf at a point.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian.
xPoint to evaluate the pdf at.
Returns:
Density of the Gaussian at x.

Definition at line 124 of file pdf.c.

double gaussian_pdf_d ( double  mu,
double  sigma,
double  x 
)

Computes the double precision univariate Gaussian pdf at a point.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian.
xPoint to evaluate the pdf at.
Returns:
Density of the Gaussian at x.

Definition at line 139 of file pdf.c.

float log_standard_gaussian_pdf_f ( float  x)

Computes the single precision log of the univariate standard Gaussian pdf at a point.

Parameters:
xValue to get the log likelihood of.
Returns:
Log density of the standard Gaussian at x.

Definition at line 162 of file pdf.c.

double log_standard_gaussian_pdf_d ( double  x)

Computes the double precision log of the univariate standard Gaussian pdf at a point.

Parameters:
xValue to get the log likelihood of.
Returns:
Log density of the standard Gaussian at x.

Definition at line 172 of file pdf.c.

float log_gaussian_pdf_f ( float  mu,
float  sigma,
float  x 
)

Computes the single precision log of the univariate Gaussian pdf at a point.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian.
xValue to get the log likelihood of.
Returns:
Log density of the Gaussian at x.

Definition at line 194 of file pdf.c.

double log_gaussian_pdf_d ( double  mu,
double  sigma,
double  x 
)

Computes the double precision log of the univariate Gaussian pdf at a point.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian.
xValue to get the log likelihood of.
Returns:
Log density of the Gaussian at x.

Definition at line 213 of file pdf.c.

float sample_standard_gaussian_pdf_f ( float  a,
float  b 
)

Draws a single precision random sample from the standard Gaussian pdf.

Parameters:
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the standard Gaussian density over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 327 of file pdf.c.

double sample_standard_gaussian_pdf_d ( double  a,
double  b 
)

Draws a double precision random sample from the standard Gaussian pdf.

Parameters:
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the standard Gaussian density over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 359 of file pdf.c.

float sample_gaussian_pdf_f ( float  mu,
float  sigma,
float  a,
float  b 
)

Draws a single precision random sample from the Gaussian pdf.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the Gaussian density with mean mu and standard deviation sigma over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 404 of file pdf.c.

double sample_gaussian_pdf_d ( double  mu,
double  sigma,
double  a,
double  b 
)

Draws a double precision random sample from the Gaussian pdf.

Parameters:
muMean of the Gaussian.
sigmaStandard deviation of the Gaussian
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the Gaussian density with mean mu and standard deviation sigma over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 447 of file pdf.c.

float sample_uniform_pdf_f ( float  a,
float  b 
)

Draws a single precision random sample from the Uniform pdf.

Parameters:
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the specified uniform density over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 706 of file pdf.c.

double sample_uniform_pdf_d ( double  a,
double  b 
)

Draws a double precision random sample from the Uniform pdf.

Parameters:
aLower bound of the sampling interval.
bUpper bound of the sampling interval.
Returns:
A random sample from the specified uniform density over the interval [a,b].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 726 of file pdf.c.

float sample_sine_pdf_f ( )

Draws a single precision random sample from the Sine pdf over the interval [0,PI/2].

Returns:
A random sample from the sine density function over the interval [0, PI/2].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 753 of file pdf.c.

double sample_sine_pdf_d ( )

Draws a double precision random sample from the Sine pdf over the interval [0.PI/2].

Returns:
A random sample from the sine density function over the interval [0, PI/2].
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 782 of file pdf.c.