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

Multivariate probability mass functions. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <inttypes.h>
#include "jwsc/vector/vector.h"
#include "jwsc/matrix/matrix.h"
Include dependency graph for mv_pmf.h:

Go to the source code of this file.

Functions

mv_bernoulli_pmf

Computes the multivariate Bernoulli pmf at a point.

void mv_bernoulli_pmf_f (float *p_out, const Vector_f *mu, const Vector_u32 *x)
 Computes the single precision multivariate Bernoulli pmf at a point.
void mv_bernoulli_pmf_d (double *p_out, const Vector_d *mu, const Vector_u32 *x)
 Computes the double precision multivariate Bernoulli pmf at a point.
sample_mv_bernoulli_pmf

Draws a random sample from the multivariate Bernoulli pmf.

void sample_mv_bernoulli_pmf_f (Vector_u32 **x_out, const Vector_f *mu)
 Draws a single precision random sample from the multivariate Bernoulli pmf.
void sample_mv_bernoulli_pmf_d (Vector_u32 **x_out, const Vector_d *mu)
 Draws a double precision random sample from the multivariate Bernoulli pmf.
set_sample_mv_bernoulli_pmf

Draws a set of random samples from the multivariate Bernoulli pmf.

void set_sample_mv_bernoulli_pmf_f (Matrix_u32 **x_out, uint32_t N, const Vector_f *mu)
 Draws a set of single precision random samples from the multivariate Bernoulli pmf.
void set_sample_mv_bernoulli_pmf_d (Matrix_u32 **x_out, uint32_t N, const Vector_d *mu)
 Draws a set of double precision random samples from the multivariate Bernoulli pmf.

Detailed Description

Multivariate probability mass functions.

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

Definition in file mv_pmf.h.


Function Documentation

void mv_bernoulli_pmf_f ( float *  p_out,
const Vector_f mu,
const Vector_u32 x 
)

Computes the single precision multivariate Bernoulli pmf at a point.

Parameters:
p_outResult parameter.
muProbabilities of success of the multivariate Bernoulli.
xValue to evaluate the pmf under.

Definition at line 75 of file mv_pmf.c.

void mv_bernoulli_pmf_d ( double *  p_out,
const Vector_d mu,
const Vector_u32 x 
)

Computes the double precision multivariate Bernoulli pmf at a point.

Parameters:
p_outResult parameter.
muProbabilities of success of the multivariate Bernoulli.
xValue to evaluate the pmf under.

Definition at line 103 of file mv_pmf.c.

void sample_mv_bernoulli_pmf_f ( Vector_u32 **  x_out,
const Vector_f mu 
)

Draws a single precision random sample from the multivariate Bernoulli pmf.

Parameters:
x_outResult paramter. Contains the sample.
muProbabilities of success of the Bernoulli.
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 143 of file mv_pmf.c.

void sample_mv_bernoulli_pmf_d ( Vector_u32 **  x_out,
const Vector_d mu 
)

Draws a double precision random sample from the multivariate Bernoulli pmf.

Parameters:
x_outResult paramter. Contains the sample.
muProbabilities of success of the Bernoulli.
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 170 of file mv_pmf.c.

void set_sample_mv_bernoulli_pmf_f ( Matrix_u32 **  x_out,
uint32_t  N,
const Vector_f mu 
)

Draws a set of single precision random samples from the multivariate Bernoulli pmf.

Parameters:
x_outResult paramter. Contains the sample.
NNumber of samples in the set.
muProbabilities of success of the Bernoulli.
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 208 of file mv_pmf.c.

void set_sample_mv_bernoulli_pmf_d ( Matrix_u32 **  x_out,
uint32_t  N,
const Vector_d mu 
)

Draws a set of double precision random samples from the multivariate Bernoulli pmf.

Parameters:
x_outResult paramter. Contains the sample.
NNumber of samples in the set.
muProbabilities of success of the Bernoulli.
Note:
Does not seed the rand() function. If this is desired, srand() must be called prior to calling this function.

Definition at line 240 of file mv_pmf.c.