docstr: Tests antithetic sampler for scale specification.
docstr_tok: ["Tests","antithetic","sampler","for","scale","specification","."]
code: def test_mean_and_scale_antithetic(self, random_type, seed):
      """Tests antithetic sampler for scale specification."""
      mean = np.array([[1.0, 0.1], [0.1, 1.0]])
      scale = np.array([[0.4, -0.1], [0.22, 1.38]])
  
      covariance = np.matmul(scale, scale.transpose())
      size = 30000
      sample = self.evaluate(
          tff_rnd.mv_normal_sample(
              [size],
              mean=mean,
              scale_matrix=scale,
              random_type=random_type,
              seed=seed,
          )
      )
      with self.subTest("Shape"):
          np.testing.assert_array_equal(sample.shape, [size, 2, 2])
      # Antithetic combination of samples should be equal to the `mean`
      antithetic_size = size // 2
      antithetic_combination = (
          sample[:antithetic_size, ...] + sample[antithetic_size:, ...]
      ) / 2
      with self.subTest("Partition"):
          np.testing.assert_allclose(
              antithetic_combination,
              mean + np.zeros([antithetic_size, 2, 2]),
              1e-10,
              1e-10,
          )
      # Get the antithetic pairs and verify normality
      with self.subTest("Mean"):
          np.testing.assert_array_almost_equal(
              np.mean(sample[:antithetic_size, ...], axis=0),
              mean,
              decimal=1,
          )
      with self.subTest("CovariancePart1"):
          np.testing.assert_array_almost_equal(
              np.cov(sample[:antithetic_size, 0, :], rowvar=False),
              covariance,
              decimal=1,
          )
      with self.subTest("CovariancePart2"):
          np.testing.assert_array_almost_equal(
              np.cov(sample[:antithetic_size, 1, :], rowvar=False),
              covariance,
              decimal=1,
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 12 for calling the RandomTest obj's underlying member method code with example usage: obj.test_mean_and_scale_antithetic(random_type, seed) without return types