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 andaccepted
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 usingset_sigma_scale
.Extends:
GlobalAdaptiveCovarianceMC
References
- acceptance_rate()¶
Returns the current (measured) acceptance rate.
- ask()¶
- eta()¶
Returns
eta
which controls the rate of adaptation decayadaptations**(-eta)
, whereeta > 0
to ensure asymptotic ergodicity.
- in_initial_phase()¶
- needs_initial_phase()¶
- needs_sensitivities()¶
Returns
True
if this methods needs sensitivities to be passed in totell
along with the evaluated logpdf.
- replace(current, current_log_pdf, proposed=None)¶
- set_eta(eta)¶
Updates
eta
which controls the rate of adaptation decayadaptations**(-eta)
, whereeta > 0
to ensure asymptotic ergodicity.
- set_initial_phase(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.