isinghm {bayess} | R Documentation |
This is the Metropolis-Hastings version of the original Gibbs algorithm
on the Ising model (Chapter 8). Its basic step only proposes changes of values at selected
pixels, avoiding the inefficient updates that do not modify the current value
of x
.
isinghm(niter, n, m=n,beta)
niter |
number of iterations of the algorithm |
n |
number of rows in the grid |
m |
number of columns in the grid |
beta |
Ising parameter |
x
, a realisation from the Ising distribution as a n
x m
matrix
of 0's and 1's
prepa=runif(1,0,2)
prop=isinghm(10,24,24,prepa)
image(1:24,1:24,prop)