pottshm | R Documentation |
ncol
classes
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.
pottshm(ncol=2,niter=10^4,n,m=n,beta=0)
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 |
returns a random realisation from the Potts model
pottsgibbs
ex=pottshm(niter=50,n=15,beta=.4)
hist(ex,prob=TRUE,col="steelblue",main="pottshm()")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.