Back to NIMBLE Vignettes

 

Background

 

Applications JAGS of Block Sampler

The JAGS block sampler (Metropolis-Hastings with multivariate normal proposal) is assigned to sample all multivariate distributions which are not otherwise conjugate. JAGS contains conjugate samplers for multivariate cases:

  • Multivariate Normal - Multivariate Normal (mean)
  • Dirichlet - Multinomial (probability)
  • Wishart - Multivariate Normal (precision)

 

General Outline of Adaptation Procedure

The JAGS block sampler has two distrinct “regimes” of operation. When the mean acceptance probability first reaches a specified range, it transitions from Regime 1 to Regime 2, never to transition back.

Regime 1: Proposal covariance begins as the Identity matrix, and the diagonal elements uniformly adapt to affect the acceptance probability.

Regime 2: Both a scale factor and the off-diagonal elements of the covariance matrix will adapt.

 

Fundamental differences from existing NIMBLE RW_block sampler
  • The existance of two distinct regimes, and a one-time transition between them.
  • Calculating the achieved acceptance probability as the mean of the actual acceptance probabilities, instead of the observed fraction of accepted proposals (as NIMBLE does).
  • Fixed target acceptance rate of 0.234 (NIMBLE has different, higher target rates, for dimensions \(d=2,3,4\)).
  • \(scale\) is updated on every iteration in both regimes; proposal covariance is updated on every iteration in Regime 2 (NIMBLE only updates these every \(adaptInterval=200\) iterations).
  • Different algorithms for adapting \(scale\) (which also differ by regime), and for adapting proposal covariance.

 

Source Code

The JAGS block sampler is called the MNormal or the MNormalMetropolis sampler, I assume for “Multivariate Normal”.

Implementation can be found in the JAGS source code:

JAGS-4.2.0/src/modules/bugs/samplers/MNormal.cc

 

Reference

According to Martyn, the adaptation algorithm is “loosely based on”:

Andrieu and Thoms, A tutorial on adaptive MCMC, Statistics and Computing 18:4 (2008).

 

Regime 1 Details

 

Initialize:

On each iteration:

Every 100 iterations:

 

Regime 2 Details

 

Initialize:

On each iteration: