MhrwAdaptive: Adaptive Random Walk Metropolis-Hastings (A-RWMH) sampler...

Description Details Methods References

Description

Adaptive Random Walk Metropolis-Hastings (A-RWMH) sampler class

Adaptive Random Walk Metropolis-Hastings (A-RWMH) sampler class

Details

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.

Methods

Public methods


Method print()

Output the current values of the sampler's state, and adaptation

Usage
MhrwAdaptive$print()

Method new()

Initialize a new Adaptive Random Walk Metropolis-Hastings sampler

Usage
MhrwAdaptive$new(
  x,
  mu,
  Sigma,
  lambda,
  lp,
  C = 0.75,
  alpha = 1,
  alpha_star = 0.44,
  adaptive = TRUE,
  adaptation_frequency = 1
)
Arguments
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


Method 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.

Usage
MhrwAdaptive$sample()

Method clone()

The objects of this class are cloneable with this method.

Usage
MhrwAdaptive$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

Andrieu, Christophe, and Johannes Thoms. "A tutorial on adaptive MCMC." Statistics and computing 18.4 (2008): 343-373.


jmhewitt/dsdive documentation built on May 29, 2020, 5:18 p.m.