code: def traverse(self):
          
  
          if self.verbose > 1:
              print_('\t' + self._id + ' Running Traverse proposal kernel')
  
          # Mask for values to move
          phi = self.phi
  
          theta = self.traverse_theta
  
          # Calculate beta
          if (random() < (theta - 1) / (2 * theta)):
              beta = exp(1 / (theta + 1) * log(random()))
          else:
              beta = exp(1 / (1 - theta) * log(random()))
  
          if self._prime:
              xp, x = self.values
          else:
              x, xp = self.values
  
          if self.verbose > 1:
              print_('\t' + 'Current value = ' + str(x))
  
          x = (xp + beta * (xp - x)) * phi + x * (phi == False)
  
          if self.verbose > 1:
              print_('\t' + 'Proposed value = ' + str(x))
  
          self.stochastic.value = x
  
          # Set proposal adjustment factor
          self.hastings_factor = (sum(phi) - 2) * log(beta)
docs: Traverse proposal kernel