Haario Bardenet ACMC¶
- class pints.HaarioBardenetACMC(x0, sigma0=None)[source]¶
Adaptive Metropolis MCMC, which is algorithm in the supplementary materials of [1], which in turn is based on [2].
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 alpha = accepted 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
- 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)¶
- class pints.AdaptiveCovarianceMCMC(x0, sigma0=None)[source]¶
Deprecated alias of
pints.HaarioBardenetACMC
.- 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()¶
- name()¶
- 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)¶