There is an algorithm to generate Dirichlet samples using a sampler for Gamma distribution for any and . We will generate Gamma distributed variables , for , and do the following variable transformation to get Dirichlet samples . First we should demonstrate that this transformation results in Dirichlet distributed samples.
Consider the following tranformation , where and . We can rewrite this transformation as , where and . Also we can imediatly calculate the inverse transformation , with . From the transformation definition we know that , implying that and .