CBOE Emulator
1.0
|
Functions for dealing with probability. More...
Functions | |
std::mt19937 | generator (getpid()) |
the global generator for the probability module. | |
template<typename T > | |
void | seed (T value) |
Set the seed for the random number generator. More... | |
template<typename T > | |
T | uniform_int (T min, T max) |
Sample a number from an integer-valued uniform distribution. More... | |
template<typename T > | |
T | uniform_real (T min, T max) |
Sample a number from a real-valued uniform distribution. More... | |
template<typename T > | |
T | normal (T mean, T stddev) |
Sample a number from a normal distribution. More... | |
template<typename T > | |
T | lognormal (T mean, T stddev) |
Sample a number from a log-normal distribution. More... | |
template<typename T > | |
T | power_law (T constant, T exponent) |
Sample a number sample from a power law distribution. More... | |
bool | boolean () |
Return the result of a coin toss. More... | |
template<typename T > | |
bool | boolean (T P) |
Return true with given probability. More... | |
Functions for dealing with probability.
|
inline |
Return the result of a coin toss.
|
inline |
Return true with given probability.
T | the class of the probability value |
P | the probability of sampling true, \(p_{true}\) |
|
inline |
Sample a number from a log-normal distribution.
T | the class of the number to sample |
mean | the mean value \(\mu\) of the distribution |
stddev | the standard deviation \(\sigma\) of the distribution |
|
inline |
Sample a number from a normal distribution.
T | the class of the number to sample |
mean | the mean value \(\mu\) of the distribution |
stddev | the standard deviation \(\sigma\) of the distribution |
|
inline |
Sample a number sample from a power law distribution.
T | the class of the number to sample |
constant | the constant value \(k\) of the distribution |
exponent | the exponent \(\alpha\) |
|
inline |
Set the seed for the random number generator.
T | the class of the seed value |
value | the seed for the random number generators |
|
inline |
Sample a number from an integer-valued uniform distribution.
T | the class of the number to sample |
min | the inclusive minimal value \(v_{min}\) to sample |
max | the inclusive maximal value \(v_{max}\) to sample |
|
inline |
Sample a number from a real-valued uniform distribution.
T | the class of the number to sample |
min | the inclusive minimal value \(v_{min}\) to sample |
max | the inclusive maximal value \(v_{max}\) to sample |