The Gibbs sampling algorithm is an iterative algorithm for sampling from a multivariate joint distribution by conditioning on each marginal distribution in sequence. This is useful if it is difficult to obtain each marginal distribution directly through integration (or summation). To simulate a distribution, we can construct a sequence of random variables (Markov chain) X" such that the stationary distribution is f(x). Consider the bivariate normal distribution X=(X1,X2) with mean p=(7,9) and variance/covariance matrix E.
To use the Gibbs sampler, we need the conditional distributions. From univariate theory, we know that the conditional distributions of a bivariate distribution are themselves normal. Implement the Gibbs sampler from page 354 to simulate this bivariate normal distribution and visualize each estimated marginal distribution.