Class MetropolisHastings

java.lang.Object
dev.nm.stat.random.rng.multivariate.mcmc.metropolis.AbstractMetropolis
dev.nm.stat.random.rng.multivariate.mcmc.metropolis.MetropolisHastings
All Implemented Interfaces:
RandomVectorGenerator, Seedable

public class MetropolisHastings extends AbstractMetropolis
A generalization of the Metropolis algorithm, which allows asymmetric proposal functions.
See Also:
    • Wikipedia: Metropolis-Hastings
    • Liu, Jun S. "Ch.5.1, The Metropolis Algorithm (p.106-107 in pdf)," Monte Carlo Strategies in Scientific Computing. 2002.
    • Matlab's mhsample
  • Constructor Details

  • Method Details

    • nextProposedState

      protected Vector nextProposedState(Vector currentState)
      Description copied from class: AbstractMetropolis
      Proposes a next state for the system.
      Specified by:
      nextProposedState in class AbstractMetropolis
      Parameters:
      currentState - the current state of the system
      Returns:
      the proposed next state
    • isProposalAccepted

      protected boolean isProposalAccepted(Vector x, Vector y)
      Description copied from class: AbstractMetropolis
      Decides whether the given proposed state should be accepted, or whether the system should remain in it's current state.
      Specified by:
      isProposalAccepted in class AbstractMetropolis
      Parameters:
      x - the current state of the system
      y - the proposed next state of the system
      Returns:
      whether the system should accept the proposed next state