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
where func_gamma.jl
is to calculate gamma function via Lanczos Approximation because there is not gamma function in Julia.
and would get more simpler expression,
Then when considering the general , we can use as instrumental distribution in Accept-Rejection algorithm as mentioned in Robert and Casella (2013):
If , we can do some further calculations,