pybop.samplers.mcmc_sampler#

Classes#

MCMCSampler

A high-level class for MCMC sampling.

Module Contents#

class pybop.samplers.mcmc_sampler.MCMCSampler(log_pdf, chains, sampler=AdaptiveCovarianceMCMC, x0=None, cov0=None, **kwargs)[source]#

A high-level class for MCMC sampling.

This class provides an alternative API to the PyBOP.Sampler() API, specifically allowing for single user-friendly interface for the optimisation process.

__getattr__(attr)[source]#

Delegate attribute access to the underlying sampler if the attribute is not found in the MCMCSampler instance.

Parameters:

attr (str) – The attribute name to be accessed.

Returns:

The attribute value from the underlying sampler.

Return type:

Any

Raises:

AttributeError – If the attribute is not found in both the MCMCSampler instance and the underlying sampler.

__setattr__(name: str, value) None[source]#

Delegate attribute setting to the underlying sampler if the attribute exists in the sampler and not in the MCMCSampler instance.

Parameters:
  • name (str) – The attribute name to be set.

  • value (Any) – The value to be set to the attribute.

run()[source]#

Run the MCMC sampling process.

Returns:

The result of the sampling process.

Return type:

list

sampler[source]#