EmceeHammerMCMC¶
-
class
pints.
EmceeHammerMCMC
(chains, x0, sigma0=None)[source]¶ Uses the differential evolution algorithm “emcee: the MCMC hammer”, described in Algorithm 2 in [1].
For
k
in1:N
:- Draw a walker
X_j
at random from the “complementary ensemble” (the group of chains not includingk
) without replacement. - Sample
z ~ g(z)
, (see below). - Set
Y = X_j(t) + z[X_k(t) - X_j(t)]
. - Set
q = z^{d - 1} p(Y) / p(X_k(t))
. - Sample
r ~ U(0, 1)
. - If
r <= q
, setX_k(t + 1)
equal toY
, if not useX_k(t)
.
Here,
N
is the number of chains (or walkers),d
is the dimensionality of the space, andg(z)
is proportional to1 / sqrt(z)
ifz
is in[1 / a, a]
or to 0, otherwise (wherea
is a parameter with default value2
).References
[1] “emcee: The MCMC Hammer”, Daniel Foreman-Mackey, David W. Hogg, Dustin Lang, Jonathan Goodman, 2013, arXiv, https://arxiv.org/pdf/1202.3665.pdf -
current_log_pdfs
()¶ Returns the log pdf values of the current points (i.e. of the most recent points returned by
tell()
).
-
in_initial_phase
()¶ For methods that need an initial phase (see
needs_initial_phase()
), this method returnsTrue
if the method is currently configured to be in its initial phase. For other methods aNotImplementedError
is returned.
-
needs_initial_phase
()¶ Returns
True
if this method needs an initial phase, for example an adaptation-free period for adaptive covariance methods, or a warm-up phase for DREAM.
-
needs_sensitivities
()¶ Returns
True
if this methods needs sensitivities to be passed in totell
along with the evaluated logpdf.
-
set_initial_phase
(in_initial_phase)¶ For methods that need an initial phase (see
needs_initial_phase()
), this method toggles the initial phase algorithm. For other methods aNotImplementedError
is returned.
- Draw a walker