Differential Evolution MCMC¶
- class pints.DifferentialEvolutionMCMC(chains, x0, sigma0=None)[source]¶
Uses differential evolution MCMC as described in [1] to perform posterior sampling from the posterior.
In each step of the algorithm
n
chains are evolved using the evolution equation:x_proposed = x[i,r] + gamma * (X[i,r1] - x[i,r2]) + epsilon
where
r1
andr2
are random chain indices chosen (without replacement) from then
available chains, which must not equali
or each other, wherei
indicates the current time step, andepsilon ~ N(0,b)
whered
is the dimensionality of the parameter vector.If
x_proposed / x[i,r] > u ~ U(0,1)
, thenx[i+1,r] = x_proposed
; otherwise,x[i+1,r] = x[i]
.Extends
MultiChainMCMC
.Note
This sampler requires a number of chains \(n \ge 3\), and recommends \(n \ge 1.5 d\).
References
- current_log_pdfs()¶
Returns the log pdf values of the current points (i.e. of the most recent points returned by
tell()
).
- gamma_switch_rate()[source]¶
Returns the number of steps between iterations where gamma is set to 1 (then reset immediately afterwards).
- 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.
- relative_scaling()[source]¶
Returns whether an error process whose standard deviation scales relatively is used (False indicates absolute scale).
- scale_coefficient()[source]¶
Sets the scale coefficient
b
of the error process used in updating the position of each chain.
- set_gamma_switch_rate(gamma_switch_rate)[source]¶
Sets the number of steps between iterations where gamma is set to 1 (then reset immediately afterwards).
- set_gaussian_error(gaussian_error)[source]¶
If
True
sets the error process to be a gaussian error,N(0, b*)
; ifFalse
, it uses a uniform errorU(-b*, b*)
; whereb* = b
if absolute scaling used andb* = mu * b
if relative scaling is used instead.
- set_hyper_parameters(x)[source]¶
The hyper-parameter vector is
[gamma, gaussian_scale_coefficient, gamma_switch_rate, gaussian_error, relative_scaling]
.
- 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.
- set_relative_scaling(relative_scaling)[source]¶
Sets whether to use an error process whose standard deviation scales relatively (
scale = self._mu * self_b
) or absolutely (scale = self._b
in all dimensions).
- set_scale_coefficient(b)[source]¶
Sets the scale coefficient
b
of the error process used in updating the position of each chain.