class_docstr: RANDOM-WALK METROPOLIS-HASTINGS MCMC
  
  Parameters
  ----------
  posterior : function
      A posterior function
  
  scale : float
      The scale for the random walk
  
  nsims : int
      The number of iterations to perform
  
  initials : np.array
      Where to start the MCMC chain
  
  cov_matrix : np.array
      (optional) A covariance matrix for the random walk
  
  thinning : int
      By how much to thin the chains (2 means drop every other point)
  
  warm_up_period : boolean
      Whether to discard first half of the chain as 'warm-up'
  
  model_object : TSM object
      A model object (for use in SPDK sampling)
  
  quiet_progress : boolean
      Whether to print progress to console or stay quiet
code: def __init__(
      self,
      posterior,
      scale,
      nsims,
      initials,
      cov_matrix=None,
      thinning=2,
      warm_up_period=True,
      model_object=None,
      quiet_progress=False,
  ):
      self.posterior = posterior
      self.scale = scale
      self.nsims = (1 + warm_up_period) * nsims * thinning
      self.initials = initials
      self.param_no = self.initials.shape[0]
      self.phi = np.zeros([self.nsims, self.param_no])
      self.phi[
          0
      ] = (
          self.initials
      )  # point from which to start the Metropolis-Hasting algorithm
      self.quiet_progress = quiet_progress
  
      if cov_matrix is None:
          self.cov_matrix = np.identity(self.param_no) * np.abs(
              self.initials
          )
      else:
          self.cov_matrix = cov_matrix
  
      self.thinning = thinning
      self.warm_up_period = warm_up_period
  
      if model_object is not None:
          self.model = model_object
  
file_path: pyflux/pyflux/inference/metropolis_hastings.py
imports: import numpy
  import sys
  from scipy.stats import multivariate_normal
  from .metropolis_sampler import metropolis_sampler
label_desc: Use image node_id 1 to create a new MetropolisHastings object from inherited base classes: object with example: obj = MetropolisHastings(posterior, scale, nsims, initials, cov_matrix, thinning, warm_up_period, model_object, quiet_progress)