Special Distribution

Gamma distribution

Firstly, let's introduce how to generate Ga(a,β){\mathcal G}a(a,\beta) where aa is an integral (Robert and Casella (2013)arrow-up-right).

Attention! The parameter in (2.2.1) is scale parameter, thus the code to sample is

Then when considering the general Ga(α,β){\mathcal G}a(\alpha,\beta), we can use Ga(a,b){G}a(a, b) as instrumental distribution in Accept-Rejection algorithm as mentioned in Robert and Casella (2013)arrow-up-right:

where func_gamma.jlarrow-up-right is to calculate gamma function via Lanczos Approximationarrow-up-right because there is not gamma function in Julia.

If β=1\beta=1, we can do some further calculations,

and would get more simpler expression,

Last updated