# NOT RUN {
# }
# NOT RUN {
#Example 1: Calculate the normalizing constant of a simple Potts model
# with the neighborhood structure corresponding to a
# first-order Markov random field defined on a
# 3*3 2D graph. The number of colors is 2 and beta=2.
# Use 11 subbetas evenly distributed between 0 and 2.
# The sampling algorithm is Swendsen-Wang with 10000
# iterations and 1000 burn-in.
edges <- getEdges(mask=matrix(1,3,3), neiStruc=c(2,2,0,0))
getNC(beta=2, subbetas=seq(0,2,by=0.2), nvertex=3*3, ncolor=2,
edges, algorithm="S", n=10000, burn=1000)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab