JWS C Library
C language utility library
|
Declarations for univariate probability mass functions. More...
#include <jwsc/config.h>
#include <stdlib.h>
#include <inttypes.h>
Go to the source code of this file.
Functions | |
poission_pmf | |
Computes the Poission pmf at a point. | |
float | poisson_pmf_f (float lambda, uint32_t n) |
Computes the double precision Poisson pmf at a point. | |
double | poisson_pmf_d (double lambda, uint32_t n) |
Computes the double precision Poisson pmf at a point. | |
sample_poisson_pmf | |
Draws a random sample from the Poisson pmf. | |
uint32_t | sample_poisson_pmf_f (float lambda, uint32_t a, uint32_t b) |
Draws a single precision random sample from the Poisson pmf. | |
uint32_t | sample_poisson_pmf_d (double lambda, uint32_t a, uint32_t b) |
Draws a double precision random sample from the Poisson pmf. | |
bernoulli_pmf | |
Computes the Bernoulli pmf at a point. | |
float | bernoulli_pmf_f (float p, uint32_t n) |
Computes the single precision Bernoulli pmf at a point. | |
double | bernoulli_pmf_d (double p, uint32_t n) |
Computes the double precision Bernoulli pmf at a point. | |
sample_bernoulli_pmf | |
Draws a random sample from the Bernoulli pmf. | |
uint8_t | sample_bernoulli_pmf_f (float p) |
Draws a single precision random sample from the Bernoulli pmf. | |
uint8_t | sample_bernoulli_pmf_d (double p) |
Draws a double precision random sample from the Bernoulli pmf. | |
geometric_pmf | |
Computes the Geometric pmf at a point. | |
float | geometric_pmf_f (float p, uint32_t n) |
Computes the single precision Geometric pmf at a point. | |
double | geometric_pmf_d (double p, uint32_t n) |
Computes the double precision Geometric pmf at a point. | |
log_geometric_pmf | |
Computes the log of the Geometric pmf at a point. | |
float | log_geometric_pmf_f (float p, uint32_t n) |
Computes the single precision log Geometric pmf at a point. | |
double | log_geometric_pmf_d (double p, uint32_t n) |
Computes the double precision log Geometric pmf at a point. | |
sample_geometric_pmf | |
Draws a random sample from the Geometric pmf. | |
uint32_t | sample_geometric_pmf_f (float p) |
Draws a single precision random sample from the Geometric pmf. | |
uint32_t | sample_geometric_pmf_d (double p) |
Draws a double precision random sample from the Geometric pmf. |
Declarations for univariate probability mass functions.
Definition in file pmf.h.
float poisson_pmf_f | ( | float | lambda, |
uint32_t | n | ||
) |
Computes the double precision Poisson pmf at a point.
lambda | Mean and variance of the Poisson. |
n | Value to get the probability of. |
double poisson_pmf_d | ( | double | lambda, |
uint32_t | n | ||
) |
Computes the double precision Poisson pmf at a point.
lambda | Mean and variance of the Poisson. |
n | Value to get the probability of. |
uint32_t sample_poisson_pmf_f | ( | float | lambda, |
uint32_t | a, | ||
uint32_t | b | ||
) |
Draws a single precision random sample from the Poisson pmf.
lambda | Mean and variance of the Poisson. |
a | Lower bound of the sampling interval. |
b | Upper bound of the sampling interval. |
uint32_t sample_poisson_pmf_d | ( | double | lambda, |
uint32_t | a, | ||
uint32_t | b | ||
) |
Draws a double precision random sample from the Poisson pmf.
lambda | Mean and variance of the Poisson. |
a | Lower bound of the sampling interval. |
b | Upper bound of the sampling interval. |
float bernoulli_pmf_f | ( | float | p, |
uint32_t | n | ||
) |
Computes the single precision Bernoulli pmf at a point.
p | Probability of success, i.e., n == 1. |
n | Value to get the probability of. Must be either 0 or 1. |
double bernoulli_pmf_d | ( | double | p, |
uint32_t | n | ||
) |
Computes the double precision Bernoulli pmf at a point.
p | Probability of success, i.e., n == 1. |
n | Value to get the probability of. Must be either 0 or 1. |
uint8_t sample_bernoulli_pmf_f | ( | float | p | ) |
Draws a single precision random sample from the Bernoulli pmf.
p | Probability of success. |
uint8_t sample_bernoulli_pmf_d | ( | double | p | ) |
Draws a double precision random sample from the Bernoulli pmf.
p | Probability of success. |
float geometric_pmf_f | ( | float | p, |
uint32_t | n | ||
) |
Computes the single precision Geometric pmf at a point.
p | Probability of success, must be in (0,1). |
n | Number of failures before a success, must be >= 0. |
Computes
(1-p)^n * p
double geometric_pmf_d | ( | double | p, |
uint32_t | n | ||
) |
Computes the double precision Geometric pmf at a point.
p | Probability of success, must be in (0,1). |
n | Number of failures before a success, must be >= 0. |
Computes
(1-p)^n * p
float log_geometric_pmf_f | ( | float | p, |
uint32_t | n | ||
) |
Computes the single precision log Geometric pmf at a point.
p | Probability of success, must be in (0,1). |
n | Number of failures before a success, must be >= 0. |
Computes
log((1-p)^n * p)
double log_geometric_pmf_d | ( | double | p, |
uint32_t | n | ||
) |
Computes the double precision log Geometric pmf at a point.
p | Probability of success, must be in (0,1). |
n | Number of failures before a success, must be >= 0. |
Computes
(1-p)^n * p
uint32_t sample_geometric_pmf_f | ( | float | p | ) |
Draws a single precision random sample from the Geometric pmf.
p | Probability of success, must be in (0,1). |
uint32_t sample_geometric_pmf_d | ( | double | p | ) |
Draws a double precision random sample from the Geometric pmf.
p | Probability of success, must be in (0,1). |