Description Details Methods References
Adaptive Random Walk Metropolis-Hastings (A-RWMH) sampler class
Adaptive Random Walk Metropolis-Hastings (A-RWMH) sampler class
A-RWMH sampling for multivariate densities, following Algorithm 6 in Andrieu and Thoms (2008). A-RWMH samplers need to maintain information about the target distribution being explored between sampler calls. When A-RWMH samplers are used as a Gibbs step, required state is a nuisance to track and increases the likelihood for implementation errors. This class is designed to make such samplers accessible by automatically/internally managing the state and required adaptation.
print()
Output the current values of the sampler's state, and adaptation
MhrwAdaptive$print()
new()
Initialize a new Adaptive Random Walk Metropolis-Hastings sampler
MhrwAdaptive$new( x, mu, Sigma, lambda, lp, C = 0.75, alpha = 1, alpha_star = 0.44, adaptive = TRUE, adaptation_frequency = 1 )
x
Initial location for sampler
mu
Initial guess of target distribution's mean
Sigma
Initial guess of target distribution's covariance matrix
lambda
Initial scaling factors, for adaptation
lp
Function to evaluate log of target density, given x
C
Base step-size scale
alpha
Power of the diminishing adaptation step size's decay
alpha_star
Target univariate acceptance rate for adaptation
adaptive
TRUE
to adapt proposal covariance Sigma
,
FALSE
otherwise.
adaptation_frequency
How often to adapt sampler parameters
sample()
Use RWMH to propose, then accept/reject, a new value from the target
distribution. If the sampler was configured with adaptive=TRUE
,
then the sampler will automatically adapt as well.
MhrwAdaptive$sample()
clone()
The objects of this class are cloneable with this method.
MhrwAdaptive$clone(deep = FALSE)
deep
Whether to make a deep clone.
Andrieu, Christophe, and Johannes Thoms. "A tutorial on adaptive MCMC." Statistics and computing 18.4 (2008): 343-373.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.