Generate a sample from a probability distribution with Adaptive Rejection Metropolis Sampling
arms.sample(target.dist, x0, sample.size, tuning=1)
Target distribution; see
Numeric vector containing initial state.
Sample size requested.
Scale for initial envelope; see details.
arms.sample implements Adaptive Rejection Metropolis
Sampling (Gilks, Best, and Tan, 1995). As described by Gilks et
al, a user of ARMS must specify an initial envelope roughly
approximating the target density. This implementation attempts
to provide a simpler interface for users by generating an envelope
To form an initial envelope for coordinate (i), four abscissae
are needed. One is
x0. The sampler tries points
k until points with log densities smaller
than that at
x0 are found, then chooses a fourth point
from the interior of the two found points. (Specifically, the
x0 and the lowest density found point is
binary-searched until a point with log-density larger than the
found point is located.)
This scheme for defining an envelope does not depend on the current state in the dimension being sampled. For discussion of why this must be the case, see see Gilks, Neal, Best and Tan (1997).
A list with elements
following the calling convention of
rejections indicates how many Metropolis-Hastings proposals
Gilks, W. R., Best, N. G., and Tan, K. K. C. (1995) “Adaptive Rejection Metropolis Sampling within Gibbs Sampling,” Applied Statistics 44(4):455-472.
Gilks, W. R., Neal, R. M., Best, N. G., and Tan, K. K. C. (1997) “Corrigendum: Adaptive Rejection Metropolis Sampling,” Applied Statistics 46(2):541-542.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.