pottshm: Metropolis-Hastings sampler for a Potts model with 'ncol'...

View source: R/pottshm.R

pottshmR Documentation

Metropolis-Hastings sampler for a Potts model with ncol classes

Description

This function returns a simulation of a n by m grid from a Potts distribution with ncol colours and a four neighbour structure, using a Metropolis-Hastings step that avoids proposing a value identical to the current state of the Markov chain.

Usage

pottshm(ncol=2,niter=10^4,n,m=n,beta=0)

Arguments

ncol

number of colors

niter

number of Metropolis-Hastings iterations

n

number of rows in the image

m

number of columns in the image

beta

parameter of the Potts model

Value

returns a random realisation from the Potts model

See Also

pottsgibbs

Examples

ex=pottshm(niter=50,n=15,beta=.4)
hist(ex,prob=TRUE,col="steelblue",main="pottshm()")

bayess documentation built on Aug. 11, 2022, 5:07 p.m.

Related to pottshm in bayess...