PottsUtils (version 0.3-3)

Wolff: Generate Random Samples from a Compound Potts Model by the Wolff Algorithm

Description

Generate random samples from a compound Potts model using the Wolff Algorithm.

Usage

Wolff(n, nvertex, ncolor, neighbors, weights, beta)

Arguments

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 neighbors. The default values are 1s for all.

beta

the parameter inverse temperature of the Potts model.

Value

A nvertex by n matrix with the kth column being the kth sample.

Details

We use the Wolff algorithm to generate random samples from a compound Potts model. See rPotts1 for more information on the compound Potts model.

References

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

See Also

SW, BlocksGibbs

Examples

Run this code
# NOT RUN {
  #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)
# }

Run the code above in your browser using DataLab