Description Usage Arguments Value Examples
This sampler is a variant of MCMC in which multiple parallel chains are run at different temperatures. The chains stochastically swap positions which allows the coldest chain to visit regions far from its starting point (unlike in MCMC). Because of this, an MC3 sampler can explore far-off regions, whereas an MCMC sampler may become stuck in a particular point of high density.
1 2 3 4 5 6 7 8 9 | sampler_mc3(
pdf,
start,
nChains = 6,
iterations = 1024,
sigma_prop = NULL,
delta_T = 4,
swap_all = TRUE
)
|
pdf |
Probability Density Function of the posterior distribution. Takes a vector as input |
start |
Vector. Starting point for the sampler |
nChains |
number of parallel chains to be run. |
iterations |
Numeric. Number of times the sampler runs |
sigma_prop |
Variance of the univariate proposal distribution. For multivariate proposals, covariance matrix of the proposal. |
delta_T |
numeric, >1. Temperature increment parameter. The bigger this number, the steeper the increase in temperature between the cold chain and the next chain |
swap_all |
Boolean. If true, every iteration attempts floor(nChains / 2) swaps. If false, only one swap per iteration. |
List with:
array of iterations x target_dimensions x nChains,
acceptance ratio for each chain,
history of swaps and
swap ratio.
If nChains == 1 items 3 and 4 are not returned
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.