Special Distribution
Last updated
Last updated
Firstly, let's introduce how to generate where is an integral (Robert and Casella (2013)).
Attention! The parameter in (2.2.1) is scale parameter, thus the code to sample is
Then when considering the general , we can use as instrumental distribution in Accept-Rejection algorithm as mentioned in Robert and Casella (2013):
where func_gamma.jl
is to calculate gamma function via Lanczos Approximation because there is not gamma function in Julia.
If , we can do some further calculations,
and would get more simpler expression,