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: Plot sampler statistics.
docstr_tok: ["Plot","sampler","statistics","."]
code: def plot(self, filename):
      """Plot sampler statistics."""
      if len(self.logstat) == 0:
          return
  
      plt.figure(figsize=(10, 1 + 3 * len(self.logstat_labels)))
      for i, label in enumerate(self.logstat_labels):
          part = [entry[i] for entry in self.logstat]
          plt.subplot(len(self.logstat_labels), 1, 1 + i)
          plt.ylabel(label)
          plt.plot(part)
          x = []
          y = []
          for j in range(0, len(part), 20):
              x.append(j)
              y.append(np.mean(part[j : j + 20]))
          plt.plot(x, y)
          if np.min(part) > 0:
              plt.yscale("log")
      plt.savefig(filename, bbox_inches="tight")
      np.savetxt(
          filename + ".txt.gz",
          self.logstat,
          header=",".join(self.logstat_labels),
          delimiter=",",
      )
      plt.close()
  
file_path: ultranest/ultranest/dychmc.py
imports: from __future__ import print_function, division
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 4 for calling the DynamicCHMCSampler obj's underlying member method code with example usage: obj.plot(filename) without return types