docstr: Test our numerical approximation of horseshoe log_prob is within bounds.
  
  Upper bounds and lower bounds derived in Appendix A of
  of Carvalho, Polson, Scott (2008)
  http://faculty.chicagobooth.edu/nicholas.polson/research/papers/Horse.pdf
docstr_tok: ["Test","our","numerical","approximation","of","horseshoe","log_prob","is","within","bounds",".","Upper","bounds","and","lower","bounds","derived","in","Appendix","A","of","of","Carvalho",",","Polson",",","Scott","(","2008",")","http",":","\/\/faculty.chicagobooth.edu\/nicholas.polson\/research\/papers\/Horse.pdf"]
code: def testHorseshoeLogPDFWithBounds(self):
      """Test our numerical approximation of horseshoe log_prob is within bounds.
  
      Upper bounds and lower bounds derived in Appendix A of
      of Carvalho, Polson, Scott (2008)
      http://faculty.chicagobooth.edu/nicholas.polson/research/papers/Horse.pdf
  
      """
      scale_np = np.array([0.5, 0.8, 1.0, 2.0, 3.0])
      x_np = np.logspace(-8, 8, 9).reshape((-1, 1))
      scale = self._test_param(scale_np)
      x = self._test_param(x_np)
      dist = horseshoe.Horseshoe(scale=scale, validate_args=True)
  
      log_pdf = dist.log_prob(x)
      self._test_batch_shapes(dist, log_pdf[0])
  
      k = 1 / np.sqrt(2 * np.pi**3)
      upper_bound = np.log(
          k * np.log1p(2.0 / (x_np / scale_np) ** 2.0)
      ) - np.log(scale_np)
      lower_bound = np.log(
          k / 2.0 * np.log1p(4.0 / (x_np / scale_np) ** 2.0)
      ) - np.log(scale_np)
  
      tolerance = 1e-5
      self.assertAllInRange(
          self.evaluate(log_pdf),
          lower_bound - tolerance,
          upper_bound + tolerance,
      )
  
imports: import numpy
  import scipy.stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import horseshoe
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 10 for calling the _HorseshoeTest obj's underlying member method code with example usage: obj.testHorseshoeLogPDFWithBounds() without return types