gagen: gagen

Description Usage Arguments Value Examples

Description

This function generates a number following gamma distribution. Summation of k i.i.d exponential random variables leads to a gamma-distribution-following random variable.(k is one of this function’s arguments). So we a)define a sum and set it to zero, b) use the expgen function to produce an exponential number, c) add the number to ‘sum’, d) repeat b) and c) k times, and then ‘sum’ would be a gamma distributed number, that will be returned.

Usage

1
gagen(x)

Arguments

k(number of exponential i.i.d random variables, landa(parameter of the underlying exponential distribution))

Value

This function generates a number following gamma distribution

Examples

1
2
3
a <- gagen(100, 0.76)
a
visualgagen(a)

Esra-K/Stats documentation built on May 29, 2019, 6:41 a.m.