queso-0.53.0
|
#include <RngBoost.h>
Public Member Functions | |
Constructor/Destructor methods | |
RngBoost (int seed, int worldRank) | |
Constructor with seed. More... | |
~RngBoost () | |
Destructor. More... | |
Public Member Functions inherited from QUESO::RngBase | |
RngBase (int seed, int worldRank) | |
Constructor with seed. More... | |
virtual | ~RngBase () |
Virtual destructor. More... | |
int | seed () const |
Sets the seed. More... | |
Sampling methods | |
boost::mt19937 | m_rng |
Random number generator from class boost::mt19937. More... | |
void | resetSeed (int newSeed) |
Resets the seed with value newSeed . More... | |
double | uniformSample () const |
Samples a value from a uniform distribution. Support: [0,1] or [a,b]. More... | |
double | gaussianSample (double stdDev) const |
double | betaSample (double alpha, double beta) const |
Samples a value from a Beta distribution. Support: [0,1]. More... | |
double | gammaSample (double a, double b) const |
Samples a value from a Gamma distribution. Support: [0,infinity). More... | |
RngBoost () | |
Default Constructor: it should not be used. More... | |
Additional Inherited Members | |
Protected Attributes inherited from QUESO::RngBase | |
int | m_seed |
Seed. More... | |
int | m_worldRank |
Rank of processor. More... | |
Definition at line 47 of file RngBoost.h.
RngBoost::RngBoost | ( | int | seed, |
int | worldRank | ||
) |
Constructor with seed.
Constructor with seed ------------------------—.
Definition at line 31 of file RngBoost.C.
References resetSeed().
RngBoost::~RngBoost | ( | ) |
|
private |
Default Constructor: it should not be used.
|
virtual |
Samples a value from a Beta distribution. Support: [0,1].
The Beta Distribution is a continuous probability distribution; it has two free parameters, which are labeled alpha and beta. The beta distribution is used as a prior distribution for binomial proportions in Bayesian analysis (Evans et al. 2000, p. 34). Uses boost::math::beta_distribution<double> beta_dist(alpha, beta). Support (domain): [0,1].
Implements QUESO::RngBase.
Definition at line 79 of file RngBoost.C.
References m_rng.
|
virtual |
Samples a value from a Gamma distribution. Support: [0,infinity).
The Gamma Distribution is a continuous probability distribution; it has two free parameters, which may be labeled: a shape parameter a and an inverse scale parameter b, called a rate parameter. The parameterization with a and b is more common in Bayesian statistics, where the gamma distribution is used as a conjugate prior distribution for various types of inverse scale (aka rate) parameters. Uses boost::math::gamma_distribution<double> gamma_dist(a,b). Support (domain): [0,infinity).
Implements QUESO::RngBase.
Definition at line 88 of file RngBoost.C.
References m_rng.
|
virtual |
Samples a value from a Gaussian distribution with standard deviation given by stdDev
. Support: (-infinity, infinity).
The parameter mu (mean or expectation of the distribution) in this Gaussian sample isn't present, and thus, needs to be provided. e.g., in the form of a sum. The parameter stdDev is its standard deviation; its variance is therefore stdDev^2. A random variable with a Gaussian distribution is said to be normally distributed and is called a normal deviate. Uses boost::math::normal_distribution<double> gaussian_dist(mean, stdDev) Support (domain): (-infinity, infinity).
Implements QUESO::RngBase.
Definition at line 69 of file RngBoost.C.
References m_rng.
|
virtual |
Resets the seed with value newSeed
.
Reimplemented from QUESO::RngBase.
Definition at line 52 of file RngBoost.C.
References m_rng.
Referenced by RngBoost().
|
virtual |
Samples a value from a uniform distribution. Support: [0,1] or [a,b].
This function samples from continuous uniform distribution on the range [0,1). It is possible to scale this distribution so the support is defined by the two parameters, a and b, which are its minimum and maximum values. Support: -infinity < a < x< b< infinity. Uses boost::uniform_01<boost::mt19937> zeroone(m_rng).
Implements QUESO::RngBase.
Definition at line 61 of file RngBoost.C.
References m_rng.
|
private |
Random number generator from class boost::mt19937.
mt19937 are models for a pseudo-random number generator. Here it is cannot be static, as it has not been initialized yet. mt19937 has length cycle of 2^(19937)-1, requires approximately 625*sizeof(uint32_t) of memory, has relatively high speed (93% of the fastest available in Boost library), and provides good uniform distribution in up to 623 dimensions.
Definition at line 110 of file RngBoost.h.
Referenced by betaSample(), gammaSample(), gaussianSample(), resetSeed(), and uniformSample().