Metropolis Random Walk MCMC

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

Metropolis Random Walk MCMC, as described in [1].

Metropolis using multivariate Gaussian distribution as proposal step, also known as Metropolis Random Walk MCMC. In each iteration (t) of the algorithm, the following occurs:

propose x' ~ N(x_t, Sigma)
generate u ~ U(0, 1)
calculate r = pi(x') / pi(x_t)
if r > u, x_t+1 = x'; otherwise, x_t+1 = x_t

here Sigma is the covariance matrix of the proposal.

Extends SingleChainMCMC.

References

acceptance_rate()[source]

Returns the current (measured) acceptance rate.

ask()[source]

See SingleChainMCMC.ask().

in_initial_phase()

For methods that need an initial phase (see needs_initial_phase()), this method returns True if the method is currently configured to be in its initial phase. For other methods a NotImplementedError is returned.

n_hyper_parameters()

Returns the number of hyper-parameters for this method (see TunableMethod).

name()[source]

See pints.MCMCSampler.name().

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 to tell along with the evaluated logpdf.

replace(current=None, current_log_pdf=None, proposed=None)[source]

See pints.SingleChainMCMC.replace().

set_hyper_parameters(x)

Sets the hyper-parameters for the method with the given vector of values (see TunableMethod).

Parameters:

x – An array of length n_hyper_parameters used to set the hyper-parameters.

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 a NotImplementedError is returned.

tell(fx)[source]

See pints.SingleChainMCMC.tell().