class_docstr: Class for performing sampling in Continuous model
  using No U Turn Sampler (a variant of Hamiltonian Monte Carlo)
  
  Parameters:
  -----------
  model: Model from which sampling has to be done
  
  simulate_dynamics: Class to propose future states of position
      and momentum in time by simulating HamiltonianDynamics
  
  References
  ----------
  Matthew D. Hoffman, Andrew Gelman, The No-U-Turn Sampler: Adaptively
  Setting Path Lengths in Hamiltonian Monte Carlo. Journal of
  Machine Learning Research 15 (2014) 1351-1381
class_docstr_tok: ["Class","for","performing","sampling","in","Continuous","model","using","No","U","Turn","Sampler","(","a","variant","of","Hamiltonian","Monte","Carlo",")","Parameters",":","--","--","--","--","--","-","model",":","Model","from","which","sampling","has","to","be","done","simulate_dynamics",":","Class","to","propose","future","states","of","position","and","momentum","in","time","by","simulating","HamiltonianDynamics","References","--","--","--","--","--","Matthew","D.","Hoffman",",","Andrew","Gelman",",","The","No-U-Turn","Sampler",":","Adaptively","Setting","Path","Lengths","in","Hamiltonian","Monte","Carlo",".","Journal","of","Machine","Learning","Research","15","(","2014",")","1351-1381"]
docstr: Initalizes root node of the tree, i.e depth = 0
docstr_tok: ["Initalizes","root","node","of","the","tree",",","i.e","depth","=","0"]
code: def _initalize_tree(self, position, momentum, slice_var, stepsize):
      """
      Initalizes root node of the tree, i.e depth = 0
      """
  
      position_bar, momentum_bar, _ = self.simulate_dynamics(
          self.model, position, momentum, stepsize
      ).get_proposed_values()
      logp_bar = self.model.logp(position_bar)
  
      hamiltonian = logp_bar - 0.5 * np.dot(momentum_bar, momentum_bar)
  
      candidate_set_size = slice_var <= np.exp(hamiltonian)
      if slice_var > 0:
          accept_set_bool = hamiltonian > (
              np.log(slice_var) - 1000
          )  # delta_max = 1000
      else:
          accept_set_bool = slice_var < np.exp(
              hamiltonian + 1000
          )  # delta_max = 1000
  
      return (
          position_bar,
          momentum_bar,
          candidate_set_size,
          accept_set_bool,
      )
  
file_path: dragonfly/dragonfly/sampling/nuts.py
imports: from __future__ import division
  import numpy
  from .base import LeapFrog
  from .hmc import HamiltonianMCDA
  from .check_functions import _check_1d_array_object
label_desc: Use image node_id 2 for calling the NoUTurnSampler obj's underlying member method code with example usage: obj._initalize_tree(position, momentum, slice_var, stepsize) and returns: position_bar,  momentum_bar,  candidate_set_size,  accept_set_bool