xneig4: Number of neighbours with the same colour

View source: R/xneig4.R

xneig4R Documentation

Number of neighbours with the same colour

Description

This is a basis function used in simulation algorithms on the Ising and Potts models. It counts how many of the four neighbours of \code{x[a,b]} are of the same colour as this pixel.

Usage

xneig4(x, a, b, col)

Arguments

x

grid of coloured pixels

a

row index

b

column index

col

current or proposed colour

Value

integer between 0 and 4 giving the number of neighbours with the same colour

See Also

pottsgibbs, sumising

Examples

data(Laichedata)
xneig4(Laichedata,2,3,1)
xneig4(Laichedata,2,3,0)

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

Related to xneig4 in bayess...