# Generate independent samples from an exponential-like distribution on a n-1 dimensional simplex

The purpose here is to generate independent samples from the following distribution:

$$P(x_1,x_2,\ldots,x_n) \propto e^{a_1x_1+a_2x_2+\cdots+a_nx_n}$$

and the support for the distribution is a n-1 dimensional simplex: $\{(x_1,x_2,\ldots,x_n):\sum_{i=1}^n x_i=1, x_i\ge0 ,i=1,2,\ldots,n\}$.

When $n=2$, it's quite easy to sample using inverse Cumulative Distribution method based on a uniform distributed random variable $u$ on $[0,1]$: $$x_1=\frac{\ln(1-(1-e^{a_1-a_2})\cdot u)}{a_1-a_2}\\ x_2=1-x_1$$

The question is can we do the similar transformation to do the sampling when $n>2$? I know we can use Gibbs sampler in this case, but that would give us dependent samples.

Any help is appreciated, thanks!

• Is there a connection with your previous question (math.stackexchange.com/q/1890574) ? – Jean Marie Aug 14 '16 at 7:00
• Yes, there is. My previous question is just to calculate the normalization constant for the above distribution. Now I'm exploring how to generate the samples from the distribution. – Negelis Aug 14 '16 at 13:20