pybop.samplers.pints_samplers#

Classes#

AdaptiveCovarianceMCMC

Implements the Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

DREAM

Implements the DiffeRential Evolution Adaptive Metropolis (DREAM) algorithm.

DifferentialEvolutionMCMC

Implements the Differential Evolution Markov Chain Monte Carlo (MCMC) algorithm.

DramACMC

Implements the Delayed Rejection Adaptive Metropolis (DRAM) Adaptive Covariance Markov Chain

EmceeHammerMCMC

Implements the Emcee Hammer Markov Chain Monte Carlo (MCMC) algorithm.

HaarioACMC

Implements the Haario Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

HaarioBardenetACMC

Implements the Haario-Bardenet Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

HamiltonianMCMC

Implements the Hamiltonian Markov Chain Monte Carlo (MCMC) algorithm.

MALAMCMC

Implements the Metropolis Adjusted Langevin Algorithm (MALA) Markov Chain Monte Carlo (MCMC) algorithm.

MetropolisRandomWalkMCMC

Implements the Metropolis Random Walk Markov Chain Monte Carlo (MCMC) algorithm.

MonomialGammaHamiltonianMCMC

Implements the Monomial Gamma Hamiltonian Markov Chain Monte Carlo (MCMC) algorithm.

NUTS

Implements the No-U-Turn Sampler (NUTS) algorithm.

PopulationMCMC

Implements the Population Markov Chain Monte Carlo (MCMC) algorithm.

RaoBlackwellACMC

Implements the Rao-Blackwell Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

RelativisticMCMC

Implements the Relativistic Markov Chain Monte Carlo (MCMC) algorithm.

SliceDoublingMCMC

Implements the Slice Doubling Markov Chain Monte Carlo (MCMC) algorithm.

SliceRankShrinkingMCMC

Implements the Slice Rank Shrinking Markov Chain Monte Carlo (MCMC) algorithm.

SliceStepoutMCMC

Implements the Slice Stepout Markov Chain Monte Carlo (MCMC) algorithm.

Module Contents#

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

Bases: pybop.BasePintsSampler

Implements the Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Adaptive Covariance MCMC sampler from the PINTS library. This MCMC method adapts the proposal distribution covariance matrix during the sampling process to improve efficiency and convergence.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Adaptive Covariance MCMC sampler.

class pybop.samplers.pints_samplers.DREAM(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the DiffeRential Evolution Adaptive Metropolis (DREAM) algorithm.

This class extends the DREAM sampler from the PINTS library. DREAM is a Markov chain Monte Carlo (MCMC) method for sampling from a probability distribution. It combines the Differential Evolution (DE) algorithm with the Adaptive Metropolis (AM) algorithm to explore the parameter space more efficiently.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the DREAM sampler.

class pybop.samplers.pints_samplers.DifferentialEvolutionMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Differential Evolution Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Differential Evolution MCMC sampler from the PINTS library. This MCMC method uses the Differential Evolution algorithm to explore the parameter space more efficiently by evolving a population of chains.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Differential Evolution MCMC sampler.

class pybop.samplers.pints_samplers.DramACMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Delayed Rejection Adaptive Metropolis (DRAM) Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the DRAM Adaptive Covariance MCMC sampler from the PINTS library. This MCMC method combines Delayed Rejection with Adaptive Metropolis to enhance the efficiency and robustness of the sampling process.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the DRAM Adaptive Covariance MCMC sampler.

class pybop.samplers.pints_samplers.EmceeHammerMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Emcee Hammer Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Emcee Hammer MCMC sampler from the PINTS library. The Emcee Hammer is an affine-invariant ensemble sampler for MCMC, which is particularly effective for high-dimensional parameter spaces.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Emcee Hammer MCMC sampler.

class pybop.samplers.pints_samplers.HaarioACMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Haario Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Haario Adaptive Covariance MCMC sampler from the PINTS library. This MCMC method adapts the proposal distribution’s covariance matrix based on the history of the chain, improving sampling efficiency and convergence.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Haario Adaptive Covariance MCMC sampler.

class pybop.samplers.pints_samplers.HaarioBardenetACMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Haario-Bardenet Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Haario-Bardenet Adaptive Covariance MCMC sampler from the PINTS library. This MCMC method combines the adaptive covariance approach with an additional mechanism to improve performance in high-dimensional parameter spaces.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Haario-Bardenet Adaptive Covariance MCMC sampler.

class pybop.samplers.pints_samplers.HamiltonianMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Hamiltonian Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Hamiltonian MCMC sampler from the PINTS library. This MCMC method uses Hamiltonian dynamics to propose new states, allowing for efficient exploration of high-dimensional parameter spaces.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Hamiltonian MCMC sampler.

class pybop.samplers.pints_samplers.MALAMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Metropolis Adjusted Langevin Algorithm (MALA) Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the MALA MCMC sampler from the PINTS library. This MCMC method combines the Metropolis-Hastings algorithm with Langevin dynamics to improve sampling efficiency and convergence.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the MALA MCMC sampler.

class pybop.samplers.pints_samplers.MetropolisRandomWalkMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Metropolis Random Walk Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Metropolis Random Walk MCMC sampler from the PINTS library. This classic MCMC method uses a simple random walk proposal distribution and the Metropolis-Hastings acceptance criterion.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Metropolis Random Walk MCMC sampler.

class pybop.samplers.pints_samplers.MonomialGammaHamiltonianMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Monomial Gamma Hamiltonian Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Monomial Gamma Hamiltonian MCMC sampler from the PINTS library. This MCMC method uses Hamiltonian dynamics with a monomial gamma distribution for efficient exploration of the parameter space.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Monomial Gamma Hamiltonian MCMC sampler.

class pybop.samplers.pints_samplers.NUTS(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the No-U-Turn Sampler (NUTS) algorithm.

This class extends the NUTS sampler from the PINTS library. NUTS is a Markov chain Monte Carlo (MCMC) method for sampling from a probability distribution. It is an extension of the Hamiltonian Monte Carlo (HMC) method, which uses a dynamic integration time to explore the parameter space more efficiently.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the NUTS sampler.

class pybop.samplers.pints_samplers.PopulationMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Population Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Population MCMC sampler from the PINTS library. This MCMC method uses a population of chains at different temperatures to explore the parameter space more efficiently and avoid local minima.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Population MCMC sampler.

class pybop.samplers.pints_samplers.RaoBlackwellACMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Rao-Blackwell Adaptive Covariance Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Rao-Blackwell Adaptive Covariance MCMC sampler from the PINTS library. This MCMC method improves sampling efficiency by combining Rao-Blackwellisation with adaptive covariance strategies.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Rao-Blackwell Adaptive Covariance MCMC sampler.

class pybop.samplers.pints_samplers.RelativisticMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Relativistic Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Relativistic MCMC sampler from the PINTS library. This MCMC method uses concepts from relativistic mechanics to propose new states, allowing for efficient exploration of the parameter space.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Relativistic MCMC sampler.

class pybop.samplers.pints_samplers.SliceDoublingMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Slice Doubling Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Slice Doubling MCMC sampler from the PINTS library. This MCMC method uses slice sampling with a doubling procedure to propose new states, allowing for efficient exploration of the parameter space.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Slice Doubling MCMC sampler.

class pybop.samplers.pints_samplers.SliceRankShrinkingMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Slice Rank Shrinking Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Slice Rank Shrinking MCMC sampler from the PINTS library. This MCMC method uses slice sampling with a rank shrinking procedure to propose new states, allowing for efficient exploration of the parameter space.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Slice Rank Shrinking MCMC sampler.

class pybop.samplers.pints_samplers.SliceStepoutMCMC(log_pdf, chains, x0=None, cov0=None, **kwargs)[source]#

Bases: pybop.BasePintsSampler

Implements the Slice Stepout Markov Chain Monte Carlo (MCMC) algorithm.

This class extends the Slice Stepout MCMC sampler from the PINTS library. This MCMC method uses slice sampling with a stepout procedure to propose new states, allowing for efficient exploration of the parameter space.

Parameters:
  • log_pdf ((pybop.LogPosterior or List[pybop.LogPosterior])) – A function that calculates the log-probability density.

  • chains (int) – The number of chains to run.

  • x0 (ndarray, optional) – Initial positions for the chains.

  • cov0 (ndarray, optional) – Initial covariance matrix.

  • **kwargs – Additional arguments to pass to the Slice Stepout MCMC sampler.