Description Usage Arguments Details
metropolis
takes a single binary chain of data in the form of an
integer vector and generates b
new independent chains of data,
placing all of them in an integer matrix with the original data in the first
row.
1 | metropolis(bin_chain, m, b)
|
bin_chain |
A single binary chain of data represented by an integer vector. |
m |
An integer representing the number of swaps to be attempted. |
b |
An integer representing the number of new chains of data to be generated. |
metropolis
works by taking the supplied bin_chain
, and
attempting m
swaps on it, only preforming a swap of elements if
doing so maintains the number of transitions between states in the resulting
chain. metropolis
then takes the resulting chain, and attempts
m
swaps on it again, then saving the resulting vector in a new row
of an output matrix. metropolis
does this b
times, each time
saving the resulting vector. Once all of the new data has been generated,
metropolis
returns the newly built integer matrix, of which the first
row is the original chain of data bin_chain
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.