Population MCMC

class pints.PopulationMCMC(x0, sigma0=None)[source]

Creates a chain of samples from a target distribution, using the population MCMC (simulated tempering) routine described in algorithm 1 in [1].

This method uses several chains internally, but only a single one is updated per iteration, and only a single one is returned at the end, hence this method is classified here as a single chain MCMC method.

The algorithm goes through the following steps (after initialising N internal chains):

1. Mutation: randomly select chain i and update the chain using a Markov kernel that admits p_i as its invariant distribution.

2. Exchange: Select another chain j at random from the remaining and swap the parameter vector of i and j with probability min(1, A),

A = p_i(x_j) * p_j(x_i) / (p_i(x_i) * p_j(x_j))

where x_i and x_j are the current values of chains i and j, respectively, where p_i = p(theta|data) ^ (1 - T_i), where p(theta|data) is the target distribution and T_i is bounded between [0, 1] and represents a tempering parameter.

We use a range of T = (0,delta_T,...,1), where delta_T = 1 / num_temperatures, and the chain with T_i = 0 is the one whose target distribution we want to sample.

Extends SingleChainMCMC.

References

ask()[source]

See SingleChainMCMC.ask().

in_initial_phase()[source]

See MCMCController.in_initial_phase().

n_hyper_parameters()[source]

See TunableMethod.n_hyper_parameters().

name()[source]

See pints.MCMCSampler.name().

needs_initial_phase()[source]

See pints.MCMCSampler.needs_initial_phase().

needs_sensitivities()

Returns True if this methods needs sensitivities to be passed in to tell along with the evaluated logpdf.

replace(current, current_log_pdf, proposed=None)

Replaces the internal current position, current LogPDF, and proposed point (if any) by the user-specified values.

This method can only be used once the initial position and LogPDF have been set (so after at least 1 round of ask-and-tell).

This is an optional method, and some samplers may not support it.

set_hyper_parameters(x)[source]

The hyper-parameter vector is [n_temperatures], where n_temperatures is an integer that will be passed to set_temperature_schedule().

Note that, since the hyper-parameter vector should be 1d (without nesting), setting an explicit temperature schedule is not supported via the hyper-parameter interface.

See TunableMethod.set_hyper_parameters().

set_initial_phase(phase)[source]

See MCMCController.set_initial_phase().

set_temperature_schedule(schedule=10)[source]

Sets a temperature schedule.

If schedule is an int it is interpreted as the number of temperatures and a schedule is generated accordingly.

If schedule is a list (or array) it is interpreted as a custom temperature schedule.

tell(fx)[source]

See pints.SingleChainMCMC.tell().

temperature_schedule()[source]

Returns the temperature schedule used in the tempering algorithm. Each temperature T pertains to particular chain whose stationary distribution is p(theta|data) ^ (1 - T).