# Burning and Sampling in Gibbs sampler [closed]

I am confused about the concept of sampling in the Gibbs sampler after the burn-in loops.

This is the basic problem, I have a picture composed of 1's and 0's. This is a noisy version and I am trying to clean it up.

Using standard Gibbs algorithm I can update each value in the matrix based on the "energy" function which is based of the values for its neighbors.

I can run the burn-in period of N loops, and i can observe how the image is in the process of getting cleaned-up.

I can also observe convergence of the energy function indicating the stability of the image that I am cleaning up.

However, the algorithm indicates that I then have to run S more loops while sampling.

Does that mean that I need to update the matrix containing my partially cleaned-up image by finding the probability of each pixel being a 1 or 0 using the rest of the matrix itself while removing the entries for the pixel being updated ?

What i mean is if i need to update (x0,y0) would I remove the entries for first row and column, count the number of 1's and the number of 0's, and based on the current value of (x0,y0), calculate if indeed (x0, y0) stays with its current value or it needs to change ?

Tips are appreciated.

## closed as unclear what you're asking by Michael Chernick, kjetil b halvorsen, mdewey, jbowman, Stephan KolassaMar 7 '18 at 8:38

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.