The Essential Math Statistics classes provide random number generators for a variety of probability distributions.
double beta |
( |
double |
w, |
|
|
double |
z |
|
) |
| |
- Header File
Returns the Beta
function:
\[ Beta(z,w) = \int\limits_0^1t^{z-1}(1-t)^{w-1}dt \]
double binomialPF |
( |
size_t |
m, |
|
|
size_t |
N, |
|
|
double |
p |
|
) |
| |
- Header File
The function binomialPF() returns the binomial probability coefficient. If an event has a probability p of occurring and we make N tries, binomialPF() returns the probability that the event will occur m times:
\[ \frac{N!}{(N-m)!m!}p^m(1-p)^{N-m} \]
double exponentialPF |
( |
double |
x, |
|
|
double |
a |
|
) |
| |
- Header File
Returns the exponential probability function. The quantity x / a has the probability distribution a exp(-ax).
double factorial |
( |
size_t |
n | ) |
|
|
inline |
- Header File
Returns the factorial of n, which is written n!. Stores previously calculated factorials internally for speed.
double gaussianPF |
( |
double |
x, |
|
|
double |
m, |
|
|
double |
s |
|
) |
| |
- Header File
Returns the Gaussian probability function for Gaussian mean m and standard deviation s:
\[ \text{Z}(x) = \frac{1}{s\sqrt{2\pi}} \exp \left ( \frac{(x-m)^2}{2s^2} \right ) \]
double logGamma |
( |
double |
x | ) |
|
- Header File
Returns the natural log of the gamma function \( \Gamma(x) \), where:
\[ \Gamma (x) = \int_{0}^{\infty} \text{t}^{x-1} \text{e}^{-t} \text{dt} \]
double lorentzianPF |
( |
double |
x, |
|
|
double |
m, |
|
|
double |
w |
|
) |
| |
- Header File
Returns the Lorentzian probability function, where m is the mean of the distribution and w is the full width at half maximum of the distribution.
double poissonPF |
( |
size_t |
n, |
|
|
double |
m |
|
) |
| |
- Header File
The Poisson distribution gives the probability of a certain integer number of unit rate Poisson random events occurring in a given time interval. The Poisson distribution represents an approximation to the binomial distribution for the special case where the average number of events is very much smaller than the possible number. The function poissonPF() returns the probability that a Poisson random event with Poisson mean m will occur, given n observations:
\[ \frac{m^n e}{n!} \frac{m^n e^{-m}}{n!} \]
double rwEpslon |
( |
double |
x | ) |
|
- Header File
Returns an estimate of the machine roundoff error in units of x, typically 1. This is frequently used to determine whether a number is near 0 relative to other numbers of order x.