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","."]
docstr: Move from position ui, Li, gradi with a HMC trajectory.
  
  Return
  ------
  unew: vector
      new position in cube space
  pnew: vector
      new position in physical parameter space
  Lnew: float
      new likelihood
  nc: int
      number of likelihood evaluations
  alpha: float
      acceptance rate of trajectory
  treeheight: int
      height of NUTS tree
docstr_tok: ["Move","from","position","ui",",","Li",",","gradi","with","a","HMC","trajectory",".","Return","--","--","--","unew",":","vector","new","position","in","cube","space","pnew",":","vector","new","position","in","physical","parameter","space","Lnew",":","float","new","likelihood","nc",":","int","number","of","likelihood","evaluations","alpha",":","float","acceptance","rate","of","trajectory","treeheight",":","int","height","of","NUTS","tree"]
code: def move(self, ui, pi, Li, region, Lmin, ndraw=1, plot=False):
      """Move from position ui, Li, gradi with a HMC trajectory.
  
      Return
      ------
      unew: vector
          new position in cube space
      pnew: vector
          new position in physical parameter space
      Lnew: float
          new likelihood
      nc: int
          number of likelihood evaluations
      alpha: float
          acceptance rate of trajectory
      treeheight: int
          height of NUTS tree
      """
  
      epsilon = self.scale
      epsilon_here = 10 ** np.random.normal(0, 0.3) * epsilon
      # epsilon_here = np.random.uniform() * epsilon
      # epsilon_here = epsilon
      d = len(ui)
  
      assert Li >= Lmin
  
      # draw from momentum
      v = generate_uniform_direction(d, self.massmatrix)
  
      # explore and sample from one trajectory
      (
          alpha,
          nreflects,
          nalpha,
          theta,
          pnew,
          Lnew,
          treeheight,
      ) = tree_sample(
          ui,
          pi,
          Li,
          v,
          epsilon_here,
          self.transform,
          self.loglike,
          self.gradient,
          Lmin,
          maxheight=15,
      )
  
      return (
          theta,
          pnew,
          Lnew,
          nalpha,
          alpha / nalpha,
          nreflects / nalpha,
          treeheight,
      )
  
file_path: ultranest/ultranest/dychmc.py
imports: from __future__ import print_function, division
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 6 for calling the DynamicCHMCSampler obj's underlying member method code with example usage: obj.move(ui, pi, Li, region, Lmin, ndraw, plot) and returns: theta,  pnew,  Lnew,  nalpha,  unknown,  unknown,  treeheight