# Distribution sampling when no analytic expression

The goal of gibbs sampling is to sample the joint distribution when this latter has not an analytic expression, by deriving the conditional distribution of each variable. So it is supposed that the conditional distribution of each variable has an analytic expression. What if they don't have it? Which method could I use?

Gibbs sampling is most efficient if you can sample directly from the conditional distributions. A common example is a Normal-Gamma mixture distribution, e.g. $$p(\mu,\lambda)=p(\mu|\lambda)p(\lambda)=Normal(\mu; \mu0, \lambda^{-1})Gamma(\lambda; a_0,b_0)$$ It's easy to sample from a Gamma or Normal distribution (which we can do directly, via their inverse CDFs), but harder to sample from the Normal-Gamma joint distribution. Gibbs sampling is useful here because direct sampling (which we can do from the conditionals but no the joint) is normally more efficient than rejection-based methods (such as Metropolis-Hastings or similar techniques).