class_docstr: Vectorized Gaussian Random Walk sampler.
docstr: Sample a new live point.
  
  Parameters
  ----------
  region: MLFriends object
      Region
  Lmin: float
      current log-likelihood threshold
  us: np.array((nlive, ndim))
      live points
  Ls: np.array(nlive)
      loglikelihoods live points
  transform: function
      prior transform function
  loglike: function
      loglikelihood function
  ndraw: int
      not used
  plot: bool
      not used
  tregion: bool
      not used
  log: bool
      not used
  
  Returns
  -------
  u: np.array(ndim) or None
      new point coordinates (None if not yet available)
  p: np.array(nparams) or None
      new point transformed coordinates (None if not yet available)
  L: float or None
      new point likelihood (None if not yet available)
  nc: int
docstr_tok: ["Sample","a","new","live","point",".","Parameters","--","--","--","--","--","region",":","MLFriends","object","Region","Lmin",":","float","current","log-likelihood","threshold","us",":","np.array","(","(","nlive",",","ndim",")",")","live","points","Ls",":","np.array","(","nlive",")","loglikelihoods","live","points","transform",":","function","prior","transform","function","loglike",":","function","loglikelihood","function","ndraw",":","int","not","used","plot",":","bool","not","used","tregion",":","bool","not","used","log",":","bool","not","used","Returns","--","--","--","-","u",":","np.array","(","ndim",")","or","None","new","point","coordinates","(","None","if","not","yet","available",")","p",":","np.array","(","nparams",")","or","None","new","point","transformed","coordinates","(","None","if","not","yet","available",")","L",":","float","or","None","new","point","likelihood","(","None","if","not","yet","available",")","nc",":","int"]
code: def __next__(
      self,
      region,
      Lmin,
      us,
      Ls,
      transform,
      loglike,
      ndraw=10,
      plot=False,
      tregion=None,
      log=False,
  ):
      """Sample a new live point.
  
      Parameters
      ----------
      region: MLFriends object
          Region
      Lmin: float
          current log-likelihood threshold
      us: np.array((nlive, ndim))
          live points
      Ls: np.array(nlive)
          loglikelihoods live points
      transform: function
          prior transform function
      loglike: function
          loglikelihood function
      ndraw: int
          not used
      plot: bool
          not used
      tregion: bool
          not used
      log: bool
          not used
  
      Returns
      -------
      u: np.array(ndim) or None
          new point coordinates (None if not yet available)
      p: np.array(nparams) or None
          new point transformed coordinates (None if not yet available)
      L: float or None
          new point likelihood (None if not yet available)
      nc: int
  
      """
      nlive, ndim = us.shape
  
      # fill if empty:
      if len(self.prepared_samples) == 0:
          # choose live points
          ilive = np.random.randint(0, nlive, size=self.popsize)
          allu = us[ilive, :]
          allp = None
          allL = Ls[ilive]
          nc = self.nsteps * self.popsize
          nrejects_expected = (
              self.nrejects + self.nsteps * self.popsize * (1 - 0.234)
          )
  
          for i in range(self.nsteps):
              # perturb walker population
              v = self.generate_direction(allu, region, self.scale)
              # compute intersection of u + t * v with unit cube
              tleft, tright = unitcube_line_intersection(allu, v)
              proposed_t = scipy.stats.truncnorm.rvs(
                  tleft, tright, loc=0, scale=1
              ).reshape((-1, 1))
  
              proposed_u = allu + v * proposed_t
              mask_outside = ~np.logical_and(
                  proposed_u > 0, proposed_u < 1
              ).all(axis=1)
              assert not mask_outside.any(), proposed_u[mask_outside, :]
  
              proposed_p = transform(proposed_u)
              # accept if likelihood threshold exceeded
              proposed_L = loglike(proposed_p)
              mask_accept = proposed_L > Lmin
              self.nrejects += (~mask_accept).sum()
              allu[mask_accept, :] = proposed_u[mask_accept, :]
              if allp is None:
                  del allp
                  allp = proposed_p * np.nan
              allp[mask_accept, :] = proposed_p[mask_accept, :]
              allL[mask_accept] = proposed_L[mask_accept]
          assert np.isfinite(
              allp
          ).all(), "some walkers never moved! Double nsteps of PopulationRandomWalkSampler."
          self.prepared_samples = list(zip(allu, allp, allL))
  
          # adapt slightly
          if self.logfile:
              self.logfile.write(
                  "rescale\t%.4f\t%.4f\t%g\n"
                  % (
                      mask_accept.mean() * 100,
                      100
                      - (
                          self.nrejects
                          - (
                              nrejects_expected
                              - self.nsteps * self.popsize * (1 - 0.234)
                          )
                      )
                      * 100.0
                      / (self.nsteps * self.popsize),
                      self.scale,
                  )
              )
          if (
              self.nrejects > nrejects_expected
              and self.scale > self.scale_min
          ):
              # lots of rejects, decrease scale
              self.scale *= self.scale_adapt_factor
          elif (
              self.nrejects < nrejects_expected
              and self.scale < self.scale_max
          ):
              self.scale /= self.scale_adapt_factor
      else:
          nc = 0
  
      u, p, L = self.prepared_samples.pop(0)
      return u, p, L, nc
  
imports: import numpy
  from ultranest.utils import submasks
  from ultranest.stepfuncs import evolve, step_back
  from ultranest.stepfuncs import generate_cube_oriented_direction, generate_cube_oriented_direction_scaled
  from ultranest.stepfuncs import generate_random_direction, generate_region_oriented_direction, generate_region_random_direction
  from ultranest.stepfuncs import generate_differential_direction, generate_mixture_random_direction
  import scipy.stats
label_desc: Use image node_id 4 for calling the PopulationRandomWalkSampler obj's underlying member method code with example usage: obj.__next__(region, Lmin, us, Ls, transform, loglike, ndraw, plot, tregion, log) and returns: u,  p,  L,  nc