GibbsSampling
Gibbssampling, more commonly known as Gibbs sampling, is a Markov chain Monte Carlo method for generating samples from a multivariate probability distribution when direct sampling is difficult. The algorithm iteratively samples each variable from its conditional distribution given the current values of all other variables. The method has strong roots in the 1980s and is widely used in Bayesian computation because the full conditional distributions are often easier to sample from than the joint distribution.
Algorithmically, suppose y = (y1, ..., yN) has target distribution p(y). Initialize y(0). For each iteration t = 1,
Convergence and diagnostics: Under mild regularity conditions, the Gibbs chain has p(y) as its stationary distribution.
Variants and extensions: Blocked Gibbs sampling updates groups of variables together to improve mixing. Collapsed Gibbs
Limitations: Mixing can be slow for highly correlated variables or complex posteriors. The method requires tractable