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
HaarioBardenetACMConly through its use ofalphain 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, does not use sensitivities.References
- acceptance_rate()¶
Returns the current (measured) acceptance rate.
- ask()¶
- eta()¶
Returns
etawhich controls the rate of adaptation decayadaptations**(-eta), whereeta > 0to ensure asymptotic ergodicity.
- in_initial_phase()¶
- n_hyper_parameters()¶
- needs_initial_phase()¶
- needs_sensitivities()¶
Returns
Trueif this methods needs sensitivities to be passed in totellalong with the evaluated logpdf.
- replace(current, current_log_pdf, proposed=None)¶
- set_eta(eta)¶
Updates
etawhich controls the rate of adaptation decayadaptations**(-eta), whereeta > 0to 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)¶