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) More... | |
| void | setup (double a, double b) |
| Set alpha and beta. More... | |
| double | operator() () |
| Get one sample. More... | |
| vec | operator() (int n) |
| Get a sample vector. More... | |
| mat | operator() (int r, int c) |
| Get a sample matrix. More... | |
| double | sample () |
| Get a sample. More... | |
Gamma distribution.
Generate samples from Gamma(alpha,beta) density, according to the following equation:
For
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::exp(), itpp::Random_Generator::genrand_close_open(), itpp::Random_Generator::genrand_open_close(), itpp::Random_Generator::genrand_open_open(), itpp::log(), and itpp::Normal_RNG::sample().
Referenced by operator()().
Generated on Wed Mar 30 2022 00:00:00 for IT++ by Doxygen 1.9.3