LibRan
0.1
Pseudo-random number distribution generator
|
The gaussian-like distributions based on the Central Limit Theorem. More...
Go to the source code of this file.
Functions | |
double | LRd_gsn2_RAN (LR_obj *o) |
LRd_gsn2_RAN(LR_obj *o) - double random g2 gaussian-like (saw tooth) distribution. More... | |
double | LRd_gsn2_PDF (LR_obj *o, double x) |
LRd_gsn2_PDF(LR_obj *o, double x) - double gaussian-like (saw tooth) probablity distribution function. More... | |
double | LRd_gsn2_CDF (LR_obj *o, double x) |
LRd_gsn2_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function. More... | |
float | LRf_gsn2_RAN (LR_obj *o) |
LRf_gsn2_RAN(LR_obj *o) - float random g2 gaussian-like (saw tooth) distribution. More... | |
float | LRf_gsn2_PDF (LR_obj *o, float x) |
LRf_gsn2_PDF(LR_obj *o, float x) - float gaussian-like (saw tooth) probablity distribution function. More... | |
float | LRf_gsn2_CDF (LR_obj *o, float x) |
LRf_gsn2_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function. More... | |
int | gs4initd (void) |
int | gs4initf (void) |
double | LRd_gsn4_RAN (LR_obj *o) |
LRd_gsn4_RAN(LR_obj *o) - double random g4 gaussian-like (simple bell curve) distribution. More... | |
double | LRd_gsn4_PDF (LR_obj *o, double x) |
LRd_gsn4_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function. More... | |
double | LRd_gsn4_CDF (LR_obj *o, double x) |
LRd_gsn4_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function. More... | |
float | LRf_gsn4_RAN (LR_obj *o) |
LRf_gsn4_RAN(LR_obj *o) - float random g4 gaussian-like (simple bell curve) distribution. More... | |
float | LRf_gsn4_PDF (LR_obj *o, float x) |
LRf_gsn4_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function. More... | |
float | LRf_gsn4_CDF (LR_obj *o, float x) |
LRf_gsn4_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function. More... | |
int | gs12initd (void) |
int | gs12initf (void) |
double | LRd_gsn12_RAN (LR_obj *o) |
LRd_gsn12_RAN(LR_obj *o) - double random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates. More... | |
double | LRd_gsn12_PDF (LR_obj *o, double x) |
LRd_gsn12_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function. More... | |
double | LRd_gsn12_CDF (LR_obj *o, double x) |
LRd_gsn12_CDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) cumulative distribution function. More... | |
float | LRf_gsn12_RAN (LR_obj *o) |
LRf_gsn12_RAN(LR_obj *o) - float random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates. More... | |
float | LRf_gsn12_PDF (LR_obj *o, float x) |
LRf_gsn12_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function. More... | |
float | LRf_gsn12_CDF (LR_obj *o, float x) |
LRf_gsn12_CDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) cumulative distribution function. More... | |
The gaussian-like distributions based on the Central Limit Theorem.
Adding two random variates will produce a new CDF which is the convolution of the two individual respective PDFs.
Here we sum some number of uniformly distributed random variates where the uniform random variate has:
A more detailed derivation can be found at page 22 of "Non-Uniform Random Variate Generation" by Luc Devroye.
The CDF of uniform random variates summed together is
The set of distributions here are by default symmetric and centered on and on an interval
, where
is the order or number of summed random variates.
The pseudo-random numbers are distributed from some lower bound "a" upto "b" (on the interval [a,b) ). The medium m = (a+b)/2, and width s = (b - a)/2
The default depends on the distribution.
The Gaussian-like random variate is just the sum of two uniformly distributed random variates. The resulting PDF is also just a saw tooth in form.
The default values are , and
.
The Gaussian-like random variate is just the sum of four uniformly distributed random variates. However, the resulting PDF exhibits the behavior of a bell curve with each segment comprised of cubic polynomials and the end points of each segment match the adjacent segments endpoints and are continuous through the second derivative ... just like cubic splines.
The CDF are quartic polynomials where the adjacent segments are continuous through the third derivative.
The default values are , and
.
The Gaussian-like random variate is of special note. It's the sum of twelve uniformly distributed random variates. This distribution closely approximates the Gaussian or Normal distribution. The variance of the distribution is equal to 1 just like the standard normal distribution, but has definite upper and lower bounds.
The PDF are segments of 11th order polynomials. The CDF are segments of 12th order polynomials. Each of the distribution functions are continuous upto the highest derivative. These distribution functions exactly represent the gsn12 random variate distribution and are not approximations.
The default values are and
. Note that this distribution uses the mean and deviation to identify the distribution characteristics. It is understood that the lower bound is
and the upper bound is
.
Definition in file LRgsn.c.
double LRd_gsn12_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn12_CDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn12_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn12_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn12_RAN | ( | LR_obj * | o | ) |
LRd_gsn12_RAN(LR_obj *o) - double random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates.
Default: mean m = 0, std.deviation s = 1
o | LR_obj object |
double LRd_gsn2_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn2_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn2_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn2_PDF(LR_obj *o, double x) - double gaussian-like (saw tooth) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn2_RAN | ( | LR_obj * | o | ) |
LRd_gsn2_RAN(LR_obj *o) - double random g2 gaussian-like (saw tooth) distribution.
Default range: [a,b) = [-1,1)
o | LR_obj object |
double LRd_gsn4_CDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn4_CDF(LR_obj *o, double x) - double gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
double LRd_gsn4_PDF | ( | LR_obj * | o, |
double | x | ||
) |
LRd_gsn4_PDF(LR_obj *o, double x) - double gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
double LRd_gsn4_RAN | ( | LR_obj * | o | ) |
LRd_gsn4_RAN(LR_obj *o) - double random g4 gaussian-like (simple bell curve) distribution.
Default range: [a,b) = [-2,2)
o | LR_obj object |
float LRf_gsn12_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn12_CDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn12_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn12_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn12_RAN | ( | LR_obj * | o | ) |
LRf_gsn12_RAN(LR_obj *o) - float random g12 gaussian-like distribution closely matches a Gaussian/Normal distribution using the sum of 12 uniform random variates.
Default: mean m = 0, std.deviation s = 1
o | LR_obj object |
float LRf_gsn2_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn2_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn2_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn2_PDF(LR_obj *o, float x) - float gaussian-like (saw tooth) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn2_RAN | ( | LR_obj * | o | ) |
LRf_gsn2_RAN(LR_obj *o) - float random g2 gaussian-like (saw tooth) distribution.
Default range: [a,b) = [-1,1)
o | LR_obj object |
float LRf_gsn4_CDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn4_CDF(LR_obj *o, float x) - float gaussian-like (saw tooth) cumulative distribution function.
o | LR_obj object |
x | value |
float LRf_gsn4_PDF | ( | LR_obj * | o, |
float | x | ||
) |
LRf_gsn4_PDF(LR_obj *o, float x) - float gaussian-like (simple bell curve) probablity distribution function.
o | LR_obj object |
x | value |
float LRf_gsn4_RAN | ( | LR_obj * | o | ) |
LRf_gsn4_RAN(LR_obj *o) - float random g4 gaussian-like (simple bell curve) distribution.
Default range: [a,b) = [-2,2)
o | LR_obj object |
long gscdfd12[13][13] |
int gscdfd4[5][5] |
long gscdfn12[13][13] |
int gscdfn4[5][5] |
long gspdfd12[13][13] |
int gspdfd4[5][5] |
long gspdfn12[13][13] |