Skip to contents

Given a closure MCMC(p,N,eps), where p is the initial Markov-chain position, N a sample-size, and eps a step-size, this function finds a good value for eps.

Usage

tune_step_size(
  MCMC,
  parMCMC = attr(MCMC, "init"),
  target_acceptance = 0.25,
  iter.max = 6
)

Arguments

MCMC

a Markov chain Monte Carlo closure (function)

parMCMC

initial position of the Markov chain, has to be initialized with mcmc_init.

target_acceptance

a scalar value for the desired acceptance rate, some algorithms are most efficient with 20% to 30% acceptance, some work well with a very high acceptance.

iter.max

maximum number of iterations until the function has to return.

Value

optimal step size

Details

It will take 100 sample points repeatedly, until an acceptance of target_acceptance is reached (defaults to 25%). The step-size is decreased if acceptance is very low and increased when it is too high.

This function will do at most