code: def testTailweightSmallGivesFewerOutliersThanNormal(self):
      batch_size = 10
      scale = rng.rand(batch_size) + 0.5
      loc = 0.1 * rng.randn(batch_size)
      norm = normal.Normal(loc=loc, scale=scale, validate_args=True)
      sasnorm = sinh_arcsinh.SinhArcsinh(
          loc=loc, scale=scale, tailweight=0.1, validate_args=True
      )
  
      # sasnorm.pdf(x) is smaller on outliers (+-10 are outliers)
      x = np.float64(
          [[-10] * batch_size, [10] * batch_size]
      )  # Shape [2, 10]
      norm_lp, sasnorm_lp = self.evaluate(
          [norm.log_prob(x), sasnorm.log_prob(x)]
      )
      np.testing.assert_array_less(sasnorm_lp, norm_lp)
  
      # 0.1% quantile and 99.9% quantile are outliers, and should be more
      # extreme in the normal.  The 97.772% quantiles should be the same.
      norm_samps, sasnorm_samps = self.evaluate(
          [
              norm.sample(int(5e5), seed=test_util.test_seed()),
              sasnorm.sample(int(5e5), seed=test_util.test_seed()),
          ]
      )
      np.testing.assert_array_less(
          np.percentile(norm_samps, 0.1, axis=0),
          np.percentile(sasnorm_samps, 0.1, axis=0),
      )
      np.testing.assert_array_less(
          np.percentile(sasnorm_samps, 99.9, axis=0),
          np.percentile(norm_samps, 99.9, axis=0),
      )
      # 100. * sp.stats.norm.cdf(2.)
      q = 100 * 0.97724986805182079
      self.assertAllClose(
          np.percentile(sasnorm_samps, q, axis=0),
          np.percentile(norm_samps, q, axis=0),
          rtol=0.03,
      )
      self.assertAllClose(
          np.percentile(sasnorm_samps, 100 - q, axis=0),
          np.percentile(norm_samps, 100 - q, axis=0),
          rtol=0.03,
      )
  
file_path: probability/tensorflow_probability/python/distributions/sinh_arcsinh_test.py
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import laplace
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sinh_arcsinh
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 5 for calling the SinhArcsinhTest obj's underlying member method code with example usage: obj.testTailweightSmallGivesFewerOutliersThanNormal() without return types