Description Usage Arguments Value Examples
gibbs_ising
is a Gibbs sampler generates data from Ising model, provided
starting config and model parameters. It is recommended that user uses a
multi-chain approach, that is, providing a matrix u
.
1 | gibbs_ising(u, h, J, n_step = 1)
|
u |
a binary (-1, 1-valued) vector or matrix. If |
h |
a vector giving the external field. |
J |
a symmetric matrix with zero diagonals giving the interaction. If
|
n_step |
the number of Gibbs steps, default = 1 |
config after Gibbs updates
1 2 3 4 5 6 | n <- 1000
p <- 3
h <- rnorm(p)
J <- matrix(0, p, p)
u <- matrix(2 * (runif(n * p) < 0.5) - 1, n, p)
gibbs_ising(u, h, J)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.