Rao-Blackwell ACMC¶
-
class
pints.
RaoBlackwellACMC
(x0, sigma0=None)[source]¶ Rao-Blackwell adaptive MCMC, as described by Algorithm 3 in [1]. After initialising mu0 and sigma0, in each iteration after initial phase (t), the following steps occur:
theta* ~ N(theta_t, lambda * sigma0) alpha(theta_t, theta*) = min(1, p(theta*|data) / p(theta_t|data)) u ~ uniform(0, 1) if alpha(theta_t, theta*) > u: theta_t+1 = theta* else: theta_t+1 = theta_t mu_t+1 = mu_t + gamma_t+1 * (theta_t+1 - mu_t) sigma_t+1 = sigma_t + gamma_t+1 * (bar((theta_t+1 - mu_t)(theta_t+1 - mu_t)') - sigma_t)
where:
bar(theta_t+1) = alpha(theta_t, theta*) theta* + (1 - alpha(theta_t, theta*)) theta_t
Note that we deviate from the paper in two places:
gamma_t = t^-eta Y_t+1 ~ N(theta_t, lambda * sigma0) rather than Y_t+1 ~ N(theta_t, sigma0)
Extends
AdaptiveCovarianceMC
.References
[1] A tutorial on adaptive MCMC Christophe Andrieu and Johannes Thoms, Statistical Computing, 2008, 18: 343-373. https://doi.org/10.1007/s11222-008-9110-y -
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
()¶
-
n_hyper_parameters
()¶
-
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_hyper_parameters
(x)¶ The hyper-parameter vector is
[eta]
.
-
set_initial_phase
(initial_phase)¶
-
set_target_acceptance_rate
(rate=0.234)¶ Sets the target acceptance rate.
-
target_acceptance_rate
()¶ Returns the target acceptance rate.
-