itpp::Gamma_RNG Class Reference
Base Module » Random Number Generation

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.

## Detailed Description

Gamma distribution.

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

For 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

Definition at line 510 of file random.h.

## Constructor & Destructor Documentation

## Gamma_RNG()

itpp::Gamma_RNG::Gamma_RNG | ( | double | a = `1.0`,
|  | double | b = `1.0`
| ) |  |

inline

Constructor, which sets alpha (a) and beta (b)

Definition at line 514 of file random.h.

## Member Function Documentation

## setup()

void itpp::Gamma_RNG::setup | ( | double | a,
|  | double | b
| ) |  |

inline

Set alpha and beta.

Definition at line 516 of file random.h.

## operator()() [1/3]

double itpp::Gamma_RNG::operator() | ( |  | ) |

inline

Get one sample.

Definition at line 518 of file random.h.

## operator()() [2/3]

vec itpp::Gamma_RNG::operator() | ( | int | n | ) |

Get a sample vector.

Definition at line 441 of file random.cpp.

References sample().

## operator()() [3/3]

mat itpp::Gamma_RNG::operator() | ( | int | r,
|  | int | c
| ) |  |

Get a sample matrix.

Definition at line 449 of file random.cpp.

References sample().

## sample()

double itpp::Gamma_RNG::sample | ( |  | ) |

Get a sample.

Definition at line 457 of file random.cpp.

References 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()(), and operator()().

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

- itpp/base/random.h
- itpp/base/random.cpp

Generated on Mon Apr 22 2024 09:45:27 for IT++ by Doxygen 1.9.8