Wolff | R Documentation |
Generate random samples from a compound Potts model using the Wolff Algorithm.
Wolff(n, nvertex, ncolor, neighbors, weights, beta)
n |
number of samples. |
nvertex |
number of vertices of a graph. |
ncolor |
number of colors each vertex can take. |
neighbors |
neighbors of a graph. |
weights |
weights between neighbors. One for each corresponding
component in |
beta |
the parameter inverse temperature of the Potts model. |
We use the Wolff algorithm to generate random samples from a compound
Potts model. See rPotts1
for more
information on the compound Potts model.
A nvertex
by n
matrix with the kth column being the kth
sample.
Ulli Wolff (1989) Collective Monte Carlo Updating for Spin Systems Physical Review Letters vol. 62, no. 4, 361-364
Dai Feng (2008) Bayesian Hidden Markov Normal Mixture Models with Application to MRI Tissue Classification Ph. D. Dissertation, The University of Iowa
SW
, BlocksGibbs
#Example 1: Generate 100 samples from a Potts model with the
# neighborhood structure corresponding to a
# second-order Markov random field defined on a
# 3*3 2D graph. The number of colors is 2.
# beta=0.7. All weights are equal to 1.
neighbors <- getNeighbors(mask=matrix(1, 3, 3), neiStruc=rep(2,4))
Wolff(n=100, nvertex=9, ncolor=2, neighbors, beta=0.7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.