# What is the difference between monte carlo integration and gibbs sampling?

I am aware that both are methods of sampling from the posterior. MC integration replaces the integral by a sample MC sample.

Is this sample independent?

Gibbs sampling is a class of MCMC techniques. It provides a dependent sample and during the iteration that produces the sample each variable is updated in turn. The result is a dependent vector of parameters that with markov property. Summary measure calculated from the chain consistently estimate the true posterior measures.

However I cannot see a real difference/link between these two?

• Hi: monte carlo integration is more of a general term usually denoting how to compute difficult integrals through sampling. MCMC is a specific technique for generating samples from some distribution that is too complex from an anaytical standpoint to compute directly. Eventually, the samples from a MCMC converge to the true underlying stationary distribution. You should probably read a textbook or notes on this material for all the gory details. There are many. I have tons somewhere but they're not in my grasp at the moment or I'd give you some recommendations. – mlofton Aug 26 '18 at 15:54
• and yes, Gibbs sampling is a specific MCMC technique. There are others but that was the workhorse at one point and probably still is. Also, anything else out there ( Metropolis-Hastings or whatever else ) is probably a variant of Gibbs sampling. – mlofton Aug 26 '18 at 15:56

Monte Carlo integration is a technique for numerically integrating a function by evaluating it at many randomly chosen points. It's useful for computing integrals when a closed form solution doesn't exist, and when the problem is high dimensional (in this case, standard numerical integration methods based on quadtrature are inefficient). The function to be integrated need not be a probability distribution.

Markov chain Monte Carlo (MCMC) refers to a class of methods for sampling from a probability distribution. It works by constructing a Markov chain whose equilibrium distribution matches the distribution of interest, then sampling from the Markov chain. This is useful when one cannot directly sample from the distribution of interest, particularly in high dimensional settings. Gibbs sampling is an MCMC method.

Monte Carlo integration and MCMC both fall under the general category of Monte Carlo methods, which use random sampling (the name refers to the Monte Carlo casino in Monaco). But, as above, they're used for completely different purposes (integrating a general function vs. sampling from a probability distribution).

A connection arises when MCMC methods are used for inference. For example, suppose we want to estimate a parameter as the mean of the posterior distribution. We can use MCMC to sample from the posterior, then take the mean of the samples. This corresponds to a form of Monte Carlo integration over the posterior.