RandomSample
Cheng's BB algorithm for generating Beta distribution random values
You're viewing an older version of this page (#233). View the current version.
Interface
#include <codecogs/statistics/distributions/continuous/beta/randomsample.h>
using namespace Statistics::Distributions::Continuous::Beta;
double generate(Stats::Random::Mersenne* method)void init(double alpha, double beta)double generate(Stats::Random::Mersenne* method)RandomSample(double alpha=1, double beta=1, double seed = 0.63245) : Mersenne(seed)inline double genReal()double genReal(double alpha, double beta)void init(double alpha, double beta)double sample(double alpha, double beta, double seed=0)
FUNCTION
generate
FUNCTION
init
FUNCTION
generate
FUNCTION
RandomSample
Parameters
FUNCTION
genReal
Generate the next random number
Interactive Calculator
Computing…
Set a range above first to export a graph.
FUNCTION
genReal
Interactive Calculator
Computing…
Set a range above first to export a graph.
FUNCTION
init
FUNCTION
sample
This function is a simple wrapper around the randomsample class provided in this module. It uses a static to keep a single instance of this class, so that each call to this function returns a new random number. As a result this function is not necessarily thread safe, in the sense that with identical initial seed, the sequence of random numbers may differ on a multitasking or multi threaded system.
The seed is only set on the first call to this function. Thereafter this parameter is ignored. If you do no want to set the seed, then we suggest you use the system clock the first time you call this function, i.e.
#include <time.h>
...
sample(alpha, beta, time(0) / MERSENNEDIV);If you require more advance behaviour, we strongly recommend that directly use the underlying class randomsample that is provided with this module.
Parameters
Interactive Calculator
Computing…
Set a range above first to export a graph.