# gagen: Gamma RV In moeinm98/distributions: Radnom variable generator

## Description

Takes argument k and lambda ,by using Exponential distribution with argument "lambda" , returns the time that the kth Gamma event occurs.

## Usage

 ```1 2``` ```gagen(k,lambda) gagen.visual(k,lambda) ```

## Arguments

 `k` ``` number of events. ``` `lambda` ``` Gamma distribution parameter. ```

## Details

In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions. The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution. There are three different parametrizations in common use:

With a shape parameter k and a scale parameter <ce><b8>. With a shape parameter <ce><b1> = k and an inverse scale parameter <ce><b2> = 1/<ce><b8>, called a rate parameter. With a shape parameter k and a mean parameter <ce><bc> = k/<ce><b2>.

In each of these three forms, both parameters are positive real numbers.

The gamma distribution is the maximum entropy probability distribution (both with respect to a uniform base measure and with respect to a 1/x base measure) for a random variable X for which E[X] = k<ce><b8> = <ce><b1>/<ce><b2> is fixed and greater than zero, and E[ln(X)] = <cf><88>(k) + ln(<ce><b8>) = <cf><88>(<ce><b1>) <e2><88><92> ln(<ce><b2>) is fixed (<cf><88> is the digamma function).

## Examples

 ```1 2``` ```gagen(5,2) gagen.visual(5,2) ```

moeinm98/distributions documentation built on May 17, 2019, 4:33 p.m.