Gibbs sampling
In statistics, Gibbs sampling or a Gibbs sampler, also known in statistical mechanics as the heat bath algorithm, is a Markov chain Monte Carlo (MCMC) algorithm for sampling from a specified multivariate probability distribution when direct sampling from the joint distribution is difficult, but sampling from the conditional distribution is more practical. This sequence can be used to approximate the joint distribution (e.g., to generate a histogram of the distribution); to approximate the marginal distribution of one of the variables, or some subset of the variables (for example, the unknown parameters or latent variables); or to compute an integral (such as the expected value of one of the... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
In statistics, Gibbs sampling or a Gibbs sampler, also known in statistical mechanics as the heat bath algorithm, is a Markov chain Monte Carlo (MCMC) algorithm for sampling from a specified multivariate probability distribution when direct sampling from the joint distribution is difficult, but sampling from the conditional distribution is more practical. This sequence can be used to approximate the joint distribution (e.g., to generate a histogram of the distribution); to approximate the marginal distribution of one of the variables, or some subset of the variables (for example, the unknown parameters or latent variables); or to compute an integral (such as the expected value of one of the variables). Typically, some of the variables correspond to observations whose values are known, and hence do not need to be sampled. Gibbs sampling is commonly used as a means of statistical inference, especially Bayesian inference. It is a randomized algorithm (i.e. an algorithm that makes use of random numbers), and is an alternative to deterministic algorithms for statistical inference such as the expectation–maximization algorithm (EM). As with other MCMC algorithms, Gibbs sampling generates a Markov chain of samples, each of which is correlated with nearby samples. As a result, care must be taken if independent samples are desired. Samples from the beginning of the chain (the burn-in period) may not accurately represent the desired distribution and are usually discarded. Gibbs sampling, in its basic incarnation, is a special case of the Metropolis–Hastings algorithm. The point of Gibbs sampling is that given a multivariate distribution it is simpler to sample from a conditional distribution than to marginalize by integrating over a joint distribution. Suppose we want to obtain k samples of a n -dimensional random vector \mathbf{X} = (X_1, \dots, X_n) . We proceed iteratively: Begin with some initial value \mathbf{X}^{(0)} . Given a sample \mathbf{X}^{(i)} = \left(x_1^{(i)}, \dots, x_n^{(i)}\right) , to obtain the next sample \mathbf{X}^{(i+1)} = \left(x_1^{(i+1)}, x_2^{(i+1)}, \dots, x_n^{(i+1)}\right) , we can sample each component x_j^{(i+1)} from the distribution of X_j , conditioned on all the components sampled so far: we condition on X_{\ell}^{(i+1)} for all \ell\leq j-1 , and on X_{\ell}^{(i)} for j+1\leq\ell\leq n . In other words, we sample x_j^{(i+1)} according to the distribution P\left(X_j=\cdot|X_1=x_1^{(i+1)}, \dots, X_{j-1}=x_{j-1}^{(i+1)}, X_{j+1}=x_{j+1}^{(i)}, \dots, X_n=x_n^{(i)}\right) . P(X_j=x_j\mid (X_i=x_i)_{i\neq j}) = \frac{P((X_i=x_i)_i)}{P((X_i=x_i)_{i\neq j})} \propto P((X_i=x_i)_i) "Proportional to" in this case means that the denominator is not a function of x_j and thus is the same for all values of x_j ; it forms part of the normalization constant for the distribution over x_j . In practice, to determine the nature of the conditional distribution of a factor x_j , it is easiest to factor the joint distribution according to the individual conditional distributions defined by the graphical model over the variables, ignore all factors that are not functions of x_j (all of which, together with the denominator above, constitute the normalization constant), and then reinstate the normalization constant at the end, as necessary. In practice, this means doing one of three things: If the distribution is discrete, the individual probabilities of all possible values of x_j are computed, and then summed to find the normalization constant. If the distribution is continuous and of a known form, the normalization constant will also be known. In other cases, the normalization constant can usually be ignored, as most sampling methods do not require it. can be proved as follows. Define x \sim_j y if \left.x_i = y_i\right. for all i \neq j and let \left.p_{xy}\right. denote the probability of a jump from x \in \Theta to y \in \Theta . Then, the transition probabilities are p_{xy} = \begin{cases} \frac{1}{d}\frac{g(y)}{\sum_{z \in \Theta: z \sim_j x} g(z) } & x \sim_j y \\ 0 & \text{otherwise} \end{cases} So g(x) p_{xy} = \frac{1}{d}\frac{ g(x) g(y)}{\sum_{z \in \Theta: z \sim_j x} g(z) } = \frac{1}{d}\frac{ g(y) g(x)}{\sum_{z \in \Theta: z \sim_j y} g(z) } = g(y) p_{yx} since x \sim_j y is an equivalence relation. Thus the detailed balance equations are satisfied, implying the chain is reversible and it has invariant distribution \left.g\right. . In practice, the index \left.j\right. is not chosen at random, and the chain cycles through the indexes in order. In general this gives a non-stationary Markov process, but each individual step will still be reversible, and the overall process will still have the desired stationary distribution (as long as the chain can access all states under the fixed ordering). \pi(\theta|y) = \frac{f(y|\theta) \cdot \pi(\theta)}{m(y)} where the marginal likelihood m(y) = \int_{\Theta} f(y|\theta) \cdot \pi(\theta) d\theta is assumed to be finite for all y . To explain the Gibbs sampler, we additionally assume that the parameter space \Theta is decomposed as \Theta = \prod_{i=1}^{K}\Theta_{i} = \Theta_1 \times \cdots \Theta_i \times \cdots \times \Theta_K, \quad\quad (K>1) , where \times represents the Cartesian product. Each component parameter space \Theta_i can be a set of scalar components, subvectors, or matrices. Define a set \Theta_{-i} that complements the \Theta_i . Essential ingredients of the Gibbs sampler is the i -th full conditional posterior distribution for each i=1,\cdots, K \pi(\theta_i|\theta_{-i},y)=\pi(\theta_i|\theta_1, \cdots, \theta_{i-1},\theta_{i+1},\cdots, \theta_{K},y) . The following algorithm details a generic Gibbs sampler: \text{Initialize: pick arbitrary starting value}\,\, \theta^{(1)} = (\theta_1^{(1)},\theta_2^{(1)},\cdots,\theta_i^{(1)},\theta_{i+1}^{(1)},\cdots,\theta_K^{(1)}) \text{Iterate a Cycle:}\, \quad\quad \text{Step 1. draw}\,\, \theta_1^{(s+1)}\sim \pi(\theta_1|\theta_2^{(s)},\theta_3^{(s)},\cdots,\theta_K^{(s)},y ) \quad\quad \text{Step 2. draw}\,\, \theta_2^{(s+1)}\sim \pi(\theta_2|\theta_1^{(s+1)},\theta_3^{(s)},\cdots,\theta_K^{(s)},y ) \quad\quad\quad \vdots \quad\quad \text{Step i. draw}\,\, \theta_i^{(s+1)}\sim \pi(\theta_i|\theta_1^{(s+1)},\theta_2^{(s+1)},\cdots, \theta_{i-1}^{(s+1)},\theta_{i+1}^{(s)} ,\cdots, \theta_K^{(s)},y ) \quad \quad \text{Step i+1. draw}\,\, \theta_{i+1}^{(s+1)}\sim \pi(\theta_{i+1}|\theta_1^{(s+1)},\theta_2^{(s+1)},\cdots, \theta_{i}^{(s+1)},\theta_{i+2}^{(s)} ,\cdots, \theta_K^{(s)},y ) \quad\quad\quad \vdots \quad\quad \text{Step K. draw}\,\, \theta_K^{(s+1)}\sim \pi(\theta_K|\theta_1^{(s+1)},\theta_2^{(s+1)},\cdots,\theta_{K-1}^{(s+1)},y ) \text{end Iterate} Note that Gibbs sampler is operated by the iterative Monte Carlo scheme within a cycle. The S number of samples \{\theta^{(s)} \}_{s=1}^{S} drawn by the above algorithm formulates Markov Chains with the invariant distribution to be the target density \pi(\theta|y) . Now, for each i=1,\cdots,K , define the following information theoretic quantities: I(\theta_i ; \theta_{-i}) = \text{KL}(\pi(\theta|y)||\pi(\theta_i|y) \cdot \pi(\theta_{-i}|y) ) H(\theta_{-i}|\theta_{i}) = -\int_{\Theta} \pi(\theta|y) \log \pi(\theta_{-i}|\theta_{i},y) d\theta, namely, posterior mutual information, posterior differential entropy, and posterior conditional differential entropy, respectively. We can similarly define information theoretic quantities I(\theta_{-i} ; \theta_{i}) , H(\theta_{i}) , and H(\theta_{i}|\theta_{-i}) by interchanging the i and -i in the defined quantities. Then, the following K equations hold. I(\theta_i ; \theta_{-i}) = H(\theta_{-i}) - H(\theta_{-i}|\theta_{i}) = H(\theta_{i}) - H(\theta_{i}|\theta_{-i}) = I(\theta_{-i} ; \theta_{i}), \quad (i=1,\cdots,K) . The mutual information I(\theta_i ; \theta_{-i}) quantifies the reduction in uncertainty of random quantity \theta_{i} once we know \theta_{-i} , a posteriori. It vanishes if and only if \theta_{i} and \theta_{-i} are marginally independent, a posterior. The mutual information I(\theta_i ; \theta_{-i}) can be interpreted as the quantity that is transmitted from the i -th step to the i+1 -th step within a single cycle of the Gibbs sampler.
Cite this
"Gibbs sampling". 1789157571. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1374408416 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy