IT++ 4.3.1
|
Gamma distribution. More...
#include <itpp/base/random.h>
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. | |
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.
|
inline |
|
inline |
|
inline |
vec itpp::Gamma_RNG::operator() | ( | int | n | ) |
mat itpp::Gamma_RNG::operator() | ( | int | r, |
int | c ) |
double itpp::Gamma_RNG::sample | ( | ) |
Get a sample.
Definition at line 457 of file random.cpp.
References itpp::log().
Referenced by operator()(), operator()(), and operator()().