class_docstr: Nested sampler with reactive exploration strategy.
  
  Storage & resume capable, optionally MPI parallelised.
class_docstr_tok: ["Nested","sampler","with","reactive","exploration","strategy",".","Storage","&","resume","capable",",","optionally","MPI","parallelised","."]
docstr: Run until target convergence criteria are fulfilled.
  
  Parameters
  ----------
  update_interval_volume_fraction: float
      Update region when the volume shrunk by this amount.
  
  update_interval_ncall: int
      Update region after update_interval_ncall likelihood calls (not used).
  
  log_interval: int
      Update stdout status line every log_interval iterations
  
  show_status: bool
      show integration progress as a status line.
      If no output desired, set to False.
  
  viz_callback: function
      callback function when region was rebuilt. Allows to
      show current state of the live points.
      See :py:func:`nicelogger` or :py:class:`LivePointsWidget`.
      If no output desired, set to False.
  
  dlogz: float
      Target evidence uncertainty. This is the std
      between bootstrapped logz integrators.
  
  dKL: float
      Target posterior uncertainty. This is the
      Kullback-Leibler divergence in nat between bootstrapped integrators.
  
  frac_remain: float
      Integrate until this fraction of the integral is left in the remainder.
      Set to a low number (1e-2 ... 1e-5) to make sure peaks are discovered.
      Set to a higher number (0.5) if you know the posterior is simple.
  
  Lepsilon: float
      Terminate when live point likelihoods are all the same,
      within Lepsilon tolerance. Increase this when your likelihood
      function is inaccurate, to avoid unnecessary search.
  
  min_ess: int
      Target number of effective posterior samples.
  
  max_iters: int
      maximum number of integration iterations.
  
  max_ncalls: int
      stop after this many likelihood evaluations.
  
  max_num_improvement_loops: int
      run() tries to assess iteratively where more samples are needed.
      This number limits the number of improvement loops.
  
  min_num_live_points: int
      minimum number of live points throughout the run
  
  cluster_num_live_points: int
      require at least this many live points per detected cluster
  
  insertion_test_zscore_threshold: float
      z-score used as a threshold for the insertion order test.
      Set to infinity to disable.
  
  insertion_test_window: int
      Number of iterations after which the insertion order test is reset.
  
  region_class: :py:class:`MLFriends` or :py:class:`RobustEllipsoidRegion` or :py:class:`SimpleRegion`
      Whether to use MLFriends+ellipsoidal+tellipsoidal region (better for multi-modal problems)
      or just ellipsoidal sampling (faster for high-dimensional, gaussian-like problems)
      or a axis-aligned ellipsoid (fastest, to be combined with slice sampling).
  
  widen_before_initial_plateau_num_warn: int
      If a likelihood plateau is encountered, increase the number
      of initial live points so that once the plateau is traversed,
      *min_num_live_points* live points remain.
      If the number exceeds *widen_before_initial_plateau_num_warn*,
      a warning is raised.
  
  widen_before_initial_plateau_num_max: int
      If a likelihood plateau is encountered, increase the number
      of initial live points so that once the plateau is traversed,
      *min_num_live_points* live points remain, but not more than
      *widen_before_initial_plateau_num_warn*.
docstr_tok: ["Run","until","target","convergence","criteria","are","fulfilled",".","Parameters","--","--","--","--","--","update_interval_volume_fraction",":","float","Update","region","when","the","volume","shrunk","by","this","amount",".","update_interval_ncall",":","int","Update","region","after","update_interval_ncall","likelihood","calls","(","not","used",")",".","log_interval",":","int","Update","stdout","status","line","every","log_interval","iterations","show_status",":","bool","show","integration","progress","as","a","status","line",".","If","no","output","desired",",","set","to","False",".","viz_callback",":","function","callback","function","when","region","was","rebuilt",".","Allows","to","show","current","state","of","the","live","points",".","See",":","py",":","func",":","`","nicelogger","`","or",":","py",":","class",":","`","LivePointsWidget","`",".","If","no","output","desired",",","set","to","False",".","dlogz",":","float","Target","evidence","uncertainty",".","This","is","the","std","between","bootstrapped","logz","integrators",".","dKL",":","float","Target","posterior","uncertainty",".","This","is","the","Kullback-Leibler","divergence","in","nat","between","bootstrapped","integrators",".","frac_remain",":","float","Integrate","until","this","fraction","of","the","integral","is","left","in","the","remainder",".","Set","to","a","low","number","(","1e-2","...","1e-5",")","to","make","sure","peaks","are","discovered",".","Set","to","a","higher","number","(","0.5",")","if","you","know","the","posterior","is","simple",".","Lepsilon",":","float","Terminate","when","live","point","likelihoods","are","all","the","same",",","within","Lepsilon","tolerance",".","Increase","this","when","your","likelihood","function","is","inaccurate",",","to","avoid","unnecessary","search",".","min_ess",":","int","Target","number","of","effective","posterior","samples",".","max_iters",":","int","maximum","number","of","integration","iterations",".","max_ncalls",":","int","stop","after","this","many","likelihood","evaluations",".","max_num_improvement_loops",":","int","run","(",")","tries","to","assess","iteratively","where","more","samples","are","needed",".","This","number","limits","the","number","of","improvement","loops",".","min_num_live_points",":","int","minimum","number","of","live","points","throughout","the","run","cluster_num_live_points",":","int","require","at","least","this","many","live","points","per","detected","cluster","insertion_test_zscore_threshold",":","float","z-score","used","as","a","threshold","for","the","insertion","order","test",".","Set","to","infinity","to","disable",".","insertion_test_window",":","int","Number","of","iterations","after","which","the","insertion","order","test","is","reset",".","region_class",":",":","py",":","class",":","`","MLFriends","`","or",":","py",":","class",":","`","RobustEllipsoidRegion","`","or",":","py",":","class",":","`","SimpleRegion","`","Whether","to","use","MLFriends+ellipsoidal+tellipsoidal","region","(","better","for","multi-modal","problems",")","or","just","ellipsoidal","sampling","(","faster","for","high-dimensional",",","gaussian-like","problems",")","or","a","axis-aligned","ellipsoid","(","fastest",",","to","be","combined","with","slice","sampling",")",".","widen_before_initial_plateau_num_warn",":","int","If","a","likelihood","plateau","is","encountered",",","increase","the","number","of","initial","live","points","so","that","once","the","plateau","is","traversed",",","*","min_num_live_points","*","live","points","remain",".","If","the","number","exceeds","*","widen_before_initial_plateau_num_warn","*",",","a","warning","is","raised",".","widen_before_initial_plateau_num_max",":","int","If","a","likelihood","plateau","is","encountered",",","increase","the","number","of","initial","live","points","so","that","once","the","plateau","is","traversed",",","*","min_num_live_points","*","live","points","remain",",","but","not","more","than","*","widen_before_initial_plateau_num_warn","*","."]
code: def run(
      self,
      update_interval_volume_fraction=0.8,
      update_interval_ncall=None,
      log_interval=None,
      show_status=True,
      viz_callback="auto",
      dlogz=0.5,
      dKL=0.5,
      frac_remain=0.01,
      Lepsilon=0.001,
      min_ess=400,
      max_iters=None,
      max_ncalls=None,
      max_num_improvement_loops=-1,
      min_num_live_points=400,
      cluster_num_live_points=40,
      insertion_test_window=10,
      insertion_test_zscore_threshold=4,
      region_class=MLFriends,
      widen_before_initial_plateau_num_warn=10000,
      widen_before_initial_plateau_num_max=50000,
  ):
      """Run until target convergence criteria are fulfilled.
  
      Parameters
      ----------
      update_interval_volume_fraction: float
          Update region when the volume shrunk by this amount.
  
      update_interval_ncall: int
          Update region after update_interval_ncall likelihood calls (not used).
  
      log_interval: int
          Update stdout status line every log_interval iterations
  
      show_status: bool
          show integration progress as a status line.
          If no output desired, set to False.
  
      viz_callback: function
          callback function when region was rebuilt. Allows to
          show current state of the live points.
          See :py:func:`nicelogger` or :py:class:`LivePointsWidget`.
          If no output desired, set to False.
  
      dlogz: float
          Target evidence uncertainty. This is the std
          between bootstrapped logz integrators.
  
      dKL: float
          Target posterior uncertainty. This is the
          Kullback-Leibler divergence in nat between bootstrapped integrators.
  
      frac_remain: float
          Integrate until this fraction of the integral is left in the remainder.
          Set to a low number (1e-2 ... 1e-5) to make sure peaks are discovered.
          Set to a higher number (0.5) if you know the posterior is simple.
  
      Lepsilon: float
          Terminate when live point likelihoods are all the same,
          within Lepsilon tolerance. Increase this when your likelihood
          function is inaccurate, to avoid unnecessary search.
  
      min_ess: int
          Target number of effective posterior samples.
  
      max_iters: int
          maximum number of integration iterations.
  
      max_ncalls: int
          stop after this many likelihood evaluations.
  
      max_num_improvement_loops: int
          run() tries to assess iteratively where more samples are needed.
          This number limits the number of improvement loops.
  
      min_num_live_points: int
          minimum number of live points throughout the run
  
      cluster_num_live_points: int
          require at least this many live points per detected cluster
  
      insertion_test_zscore_threshold: float
          z-score used as a threshold for the insertion order test.
          Set to infinity to disable.
  
      insertion_test_window: int
          Number of iterations after which the insertion order test is reset.
  
      region_class: :py:class:`MLFriends` or :py:class:`RobustEllipsoidRegion` or :py:class:`SimpleRegion`
          Whether to use MLFriends+ellipsoidal+tellipsoidal region (better for multi-modal problems)
          or just ellipsoidal sampling (faster for high-dimensional, gaussian-like problems)
          or a axis-aligned ellipsoid (fastest, to be combined with slice sampling).
  
      widen_before_initial_plateau_num_warn: int
          If a likelihood plateau is encountered, increase the number
          of initial live points so that once the plateau is traversed,
          *min_num_live_points* live points remain.
          If the number exceeds *widen_before_initial_plateau_num_warn*,
          a warning is raised.
  
      widen_before_initial_plateau_num_max: int
          If a likelihood plateau is encountered, increase the number
          of initial live points so that once the plateau is traversed,
          *min_num_live_points* live points remain, but not more than
          *widen_before_initial_plateau_num_warn*.
      """
      for result in self.run_iter(
          update_interval_volume_fraction=update_interval_volume_fraction,
          update_interval_ncall=update_interval_ncall,
          log_interval=log_interval,
          dlogz=dlogz,
          dKL=dKL,
          Lepsilon=Lepsilon,
          frac_remain=frac_remain,
          min_ess=min_ess,
          max_iters=max_iters,
          max_ncalls=max_ncalls,
          max_num_improvement_loops=max_num_improvement_loops,
          min_num_live_points=min_num_live_points,
          cluster_num_live_points=cluster_num_live_points,
          show_status=show_status,
          viz_callback=viz_callback,
          insertion_test_window=insertion_test_window,
          insertion_test_zscore_threshold=insertion_test_zscore_threshold,
          region_class=region_class,
          widen_before_initial_plateau_num_warn=widen_before_initial_plateau_num_warn,
          widen_before_initial_plateau_num_max=widen_before_initial_plateau_num_max,
      ):
          if self.log:
              self.logger.debug("did a run_iter pass!")
          pass
      if self.log:
          self.logger.info("done iterating.")
  
      return self.results
  
imports: from __future__ import print_function, division
  import os
  import sys
  import csv
  import json
  import operator
  import time
  import warnings
  from numpy import log, exp, logaddexp
  import numpy
  from .utils import create_logger, make_run_dir, resample_equal, vol_prefactor, vectorize, listify
  from .utils import is_affine_transform, normalised_kendall_tau_distance, distributed_work_chunk_size
  from ultranest.mlfriends import MLFriends, AffineLayer, ScalingLayer, find_nearby, WrappingEllipsoid, RobustEllipsoidRegion
  from .store import HDF5PointStore, TextPointStore, NullPointStore
  from .viz import get_default_viz_callback
  from .ordertest import UniformOrderAccumulator
  from .netiter import PointPile, SingleCounter, MultiCounter, BreadthFirstIterator, TreeNode, count_tree_between, find_nodes_before, logz_sequence
  from .netiter import dump_tree, combine_results
  from .hotstart import get_auxiliary_contbox_parameterization
label_desc: Use image node_id 15 for calling the ReactiveNestedSampler obj's underlying member method code with example usage: obj.run(update_interval_volume_fraction, update_interval_ncall, log_interval, show_status, viz_callback, dlogz, dKL, frac_remain, Lepsilon, min_ess, max_iters, max_ncalls, max_num_improvement_loops, min_num_live_points, cluster_num_live_points, insertion_test_window, insertion_test_zscore_threshold, region_class, widen_before_initial_plateau_num_warn, widen_before_initial_plateau_num_max) and returns: self