itpp::Gamma_RNG Class Reference
[Random Number Generation]

Gamma distribution

Generate samples from Gamma(alpha,beta) density, according to the following equation:

\[ x \sim \Gamma(\alpha,\beta) = \frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1} \exp(-\beta x) \]

. More...

#include <random.h>

List of all members.

Public Member Functions

 Gamma_RNG (double a=1.0, double b=1.0)
 Constructor, which sets alpha (a) and beta (b).
void setup (double a, double b)
 Set alpha and beta.
double operator() ()
 Get one sample.
vec operator() (int n)
 Get a sample vector.
mat operator() (int r, int c)
 Get a sample matrix.
double sample ()
 Get a sample.


Detailed Description

Gamma distribution

Generate samples from Gamma(alpha,beta) density, according to the following equation:

\[ x \sim \Gamma(\alpha,\beta) = \frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1} \exp(-\beta x) \]

.

For $\alpha=1$ the Gamma distribution is equivalent to the Exponential distribution.

Note:
The implementation of the sample() function was adapted from the R statistical language.
Author:
Vasek Smidl

The documentation for this class was generated from the following files:

Generated on Tue Jun 2 10:02:19 2009 for mixpp by  doxygen 1.5.8