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
nchains are evolved using the evolution equation:x_proposed = x[i,r] + gamma * (X[i,r1] - x[i,r2]) + epsilon
where
r1andr2are random chain indices chosen (without replacement) from thenavailable chains, which must not equalior each other, whereiindicates the current time step, andepsilon ~ N(0,b)wheredis 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, does not use sensitivities.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 returnsTrueif the method is currently configured to be in its initial phase. For other methods aNotImplementedErroris returned.
- needs_initial_phase()¶
Returns
Trueif 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
Trueif this methods needs sensitivities to be passed in totellalong 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
bof 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
Truesets the error process to be a gaussian error,N(0, b*); ifFalse, it uses a uniform errorU(-b*, b*); whereb* = bif absolute scaling used andb* = mu * bif 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 aNotImplementedErroris 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._bin all dimensions).
- set_scale_coefficient(b)[source]¶
Sets the scale coefficient
bof the error process used in updating the position of each chain.