Haario ACMC¶
-
class
pints.
HaarioACMC
(x0, sigma0=None)[source]¶ Adaptive Metropolis MCMC, which is algorithm 4 in [1] and is described in the text in [2].
This algorithm differs from
HaarioBardenetACMC
only through its use ofalpha
in the updating oflog_lambda
(rather than a binary accept/reject).Initialise:
mu Sigma adaptation_count = 0 log lambda = 0
In each adaptive iteration (t):
adaptation_count = adaptation_count + 1 gamma = (adaptation_count)^-eta theta* ~ N(theta_t, lambda * Sigma) alpha = min(1, p(theta*|data) / p(theta_t|data)) u ~ uniform(0, 1) if alpha > u: theta_(t+1) = theta* accepted = 1 else: theta_(t+1) = theta_t accepted = 0 mu = (1 - gamma) mu + gamma theta_(t+1) Sigma = (1 - gamma) Sigma + gamma (theta_(t+1) - mu)(theta_(t+1) - mu) log lambda = log lambda + gamma (alpha - self._target_acceptance) gamma = adaptation_count^-eta
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 [2] An adaptive Metropolis algorithm Heikki Haario, Eero Saksman, and Johanna Tamminen (2001) Bernoulli. -
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.
-
tell
(fx)¶
-