isinghm: Metropolis-Hastings for the Ising model

View source: R/isinghm.R

isinghmR Documentation

Metropolis-Hastings for the Ising model

Description

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.

Usage

isinghm(niter, n, m=n,beta)

Arguments

niter

number of iterations of the algorithm

n

number of rows in the grid

m

number of columns in the grid

beta

Ising parameter

Value

x, a realisation from the Ising distribution as a n x m matrix of 0's and 1's

See Also

isingibbs

Examples

prepa=runif(1,0,2)
prop=isinghm(10,24,24,prepa)
image(1:24,1:24,prop)

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

Related to isinghm in bayess...