Generate a sample from a probability distribution with the Adaptive Metropolis algorithm
Target distribution; see
Numeric vector containing initial state.
Requested sample size.
Standard deviation of first component of proposal distribution
Weight of first component of proposal distribution
Stop adaptation after this fraction of the chain. Set this to 1.0 to obtain the behavior described by Roberts and Rosenthal (2009).
This function implements the Adaptive Metropolis algorithm as
described by Roberts and Rosenthal (2009). Proposals are a mixture
of a spherical Gaussian with standard deviation equal to
tuning/sqrt(target.dist$ndim) (with weight
and a Gaussian with covariance equal to the sample covariance of
the already-computed observations scaled by
2.38^2/target.dist$ndim (with weight
The resulting Markov chain is not strictly stationary with the
target distribution for the burn-in period of the chain, but
A list containing the elements
sample.cov. This sampler follows
the calling convention of
reject.rate contains the fraction of proposals that were
sample.cov is the most recent sample covariance
used to update the proposal distribution.
Roberts, G. O. and Rosenthal, J. S. (2009), “Examples of Adaptive MCMC,” Journal of Computational and Graphical Statistics 18(2):349-367.
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.