class_docstr: Dynamic Constrained Hamiltonian/Hybrid Monte Carlo technique
  
  Run a billiard ball inside the likelihood constrained.
  The ball reflects off the constraint.
  
  The trajectory is explored in steps of stepsize epsilon.
  A No-U-turn criterion and randomized doubling of forward or backward
  steps is used to avoid repeating circular trajectories.
  Because of this, the number of steps is dynamic.
  
  Parameters
  -----------
  nsteps: int
      number of accepted steps until the sample is considered independent.
  adaptive_nsteps: False, 'proposal-distance', 'move-distance'
      if not false, allow earlier termination than nsteps.
      The 'proposal-distance' strategy stops when the sum of
      all proposed vectors exceeds the mean distance
      between pairs of live points.
      As distance, the Mahalanobis distance is used.
      The 'move-distance' strategy stops when the distance between
      start point and current position exceeds the mean distance
      between pairs of live points.
  delta: float
      step size
  nudge: float
      change in step size, must be >1.
class_docstr_tok: ["Dynamic","Constrained","Hamiltonian\/Hybrid","Monte","Carlo","technique","Run","a","billiard","ball","inside","the","likelihood","constrained",".","The","ball","reflects","off","the","constraint",".","The","trajectory","is","explored","in","steps","of","stepsize","epsilon",".","A","No-U-turn","criterion","and","randomized","doubling","of","forward","or","backward","steps","is","used","to","avoid","repeating","circular","trajectories",".","Because","of","this",",","the","number","of","steps","is","dynamic",".","Parameters","--","--","--","--","--","-","nsteps",":","int","number","of","accepted","steps","until","the","sample","is","considered","independent",".","adaptive_nsteps",":","False",",","'proposal-distance","'",",","'move-distance'","if","not","false",",","allow","earlier","termination","than","nsteps",".","The","'proposal-distance","'","strategy","stops","when","the","sum","of","all","proposed","vectors","exceeds","the","mean","distance","between","pairs","of","live","points",".","As","distance",",","the","Mahalanobis","distance","is","used",".","The","'move-distance","'","strategy","stops","when","the","distance","between","start","point","and","current","position","exceeds","the","mean","distance","between","pairs","of","live","points",".","delta",":","float","step","size","nudge",":","float","change","in","step","size",",","must","be",">","1","."]
code: def __init__(
      self, scale, nsteps, adaptive_nsteps=False, delta=0.9, nudge=1.04
  ):
      self.history = []
      self.nsteps = nsteps
      self.scale = scale
      self.nudge = nudge
      self.nsteps_nudge = 1.01
      adaptive_nsteps_options = (
          False,
          "proposal-total-distances-NN",
          "proposal-summed-distances-NN",
          "proposal-total-distances",
          "proposal-summed-distances",
          "move-distance",
          "move-distance-midway",
          "proposal-summed-distances-min-NN",
          "proposal-variance-min",
          "proposal-variance-min-NN",
      )
  
      if adaptive_nsteps not in adaptive_nsteps_options:
          raise ValueError(
              "adaptive_nsteps must be one of: %s, not '%s'"
              % (adaptive_nsteps_options, adaptive_nsteps)
          )
      self.adaptive_nsteps = adaptive_nsteps
      self.mean_pair_distance = np.nan
      self.delta = delta
      self.massmatrix = 1
      self.invmassmatrix = 1
  
      self.logstat = []
      self.logstat_labels = [
          "acceptance_rate",
          "reflect_fraction",
          "stepsize",
          "treeheight",
      ]
      if adaptive_nsteps:
          self.logstat_labels += ["jump-distance", "reference-distance"]
      self.logstat_trajectory = []
  
file_path: ultranest/ultranest/dychmc.py
imports: from __future__ import print_function, division
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 1 to create a new DynamicCHMCSampler object from inherited base classes: object with example: obj = DynamicCHMCSampler(scale, nsteps, adaptive_nsteps, delta, nudge)