Learn R Programming

bayess (version 1.4)

pottsgibbs: Gibbs sampler for the Potts model

Description

This function produces one simulation of a square numb by numb grid from a Potts distribution with four colours and a four neighbour structure, relying on niter iterations of a standard Gibbs sampler.

Usage

pottsgibbs(niter, numb, beta)

Arguments

niter
number of Gibbs iterations
numb
size of the square grid
beta
parameter of the Potts model

Value

  • returns a random realisation from the Potts model

References

Geman, S. and Geman, D. (1984) Stochastic relaxation, Gibbs distributions and the Bayesian restoration of images. IEEE Trans. Pattern Anal. Mach. Intell., 6, 721--741.

See Also

pottshm

Examples

Run this code
ex=pottsgibbs(100,15,.4)
image(ex)

Run the code above in your browser using DataLab