Dram ACMC

class pints.DramACMC(x0, sigma0=None)[source]

DRAM (Delayed Rejection Adaptive Covariance) MCMC, as described in [1].

In this method, rejections do not necessarily lead an iteration to end. Instead, if a rejection occurs, another point is proposed although typically from a narrower (i.e. more conservative) proposal kernel than was used for the first proposal.

The number of proposal kernels is fixed to 2.

In this approach, in each iteration, the following steps return the next state of the Markov chain (assuming the current state is theta_0):

theta_1 ~ N(theta_0, lambda * scale_1 * sigma)
alpha_1(theta_0, theta_1) = min(1, p(theta_1|X) / p(theta_0|X))
u_1 ~ uniform(0, 1)
if alpha_1(theta_0, theta_1) > u_1:
    return theta_1
theta_2 ~ N(theta_0, lambda * scale_2 * sigma0)
alpha_2(theta_0, theta_1, theta_2) =
    min(1, p(theta_2|X) (1 - alpha_1(theta_2, theta_1)) /
           (p(theta_0|X) (1 - alpha_1(theta_0, theta_1))))
u_2 ~ uniform(0, 1)
if alpha_2(theta_0, theta_1, theta_2) > u_2:
    return theta_2
else:
    return theta_0

At the end of each iterations, a ‘base’ proposal kernel is adapted:

mu = (1 - gamma) mu + gamma theta
sigma = (1 - gamma) sigma + gamma (theta - mu)(theta - mu)^t
log_lambda = log_lambda + gamma (accepted - target_acceptance_rate)

where gamma = adaptations^-eta, theta is the current state of the Markov chain and accepted is a binary indicator for whether any of the series of proposals were accepted. The kernels for the two proposals are then adapted as [scale_1, scale_2] * sigma, where the scale factors are set using set_sigma_scale.

Extends: GlobalAdaptiveCovarianceMC

References

acceptance_rate()

Returns the current (measured) acceptance rate.

ask()

See SingleChainMCMC.ask().

eta()

Returns eta which controls the rate of adaptation decay adaptations**(-eta), where eta > 0 to ensure asymptotic ergodicity.

in_initial_phase()

See pints.MCMCSampler.in_initial_phase().

n_hyper_parameters()[source]

See TunableMethod.n_hyper_parameters().

name()[source]

See pints.MCMCSampler.name().

needs_initial_phase()

See pints.MCMCSampler.needs_initial_phase().

needs_sensitivities()

Returns True if this methods needs sensitivities to be passed in to tell along with the evaluated logpdf.

replace(current, current_log_pdf, proposed=None)

See pints.SingleChainMCMC.replace().

set_eta(eta)

Updates eta which controls the rate of adaptation decay adaptations**(-eta), where eta > 0 to ensure asymptotic ergodicity.

set_hyper_parameters(x)[source]

The hyper-parameter vector is [eta, sigma_scale_1, sigma_scale_2].

See TunableMethod.set_hyper_parameters().

set_initial_phase(initial_phase)

See pints.MCMCSampler.set_initial_phase().

set_sigma_scale(scales)[source]

Set the scale of the mulipliers for the two proposal kernel covariance matrices. Must be of the form [scale_1, scale_2].

set_target_acceptance_rate(rate=0.234)

Sets the target acceptance rate.

sigma_scale()[source]

Returns scale factors used to multiply a base covariance matrix, resulting in proposal matrices for each accept-reject step.

target_acceptance_rate()

Returns the target acceptance rate.

tell(fx)[source]

If first proposal, then accept with ordinary Metropolis probability; if a later proposal, use probability determined by [1].