I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
COST (GBP)
this unit 4.80
sub units 1.98
+
0

Random Sample

Cheng's BB algorithm for generating Beta distribution random values
Controller: CodeCogs

add cart

Dependents

Info

Interface

C++

Class RandomSample

This class uses the other two classes that live inside this module to create random values from the Beta distribution. Cheng's algorithm is used.
Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.

Members of RandomSample

RandomSample

 
RandomSampledoublealpha = 1
doublebeta = 1
doubleseed = 0.63245 )[constructor]
alphaDefault Value = 1
betaDefault Value = 1
seedDefault value = 0.63245


Sample

 
doublesampledoublealpha
doublebeta
doubleseed = 0 )
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

alphafirst shape parameter for the beta distribution
betasecond shape parameter for the beta distribution
seedsets the initial seed for the random generator. Only used in the first call to this function
Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.