code: def test_sampled_scale_follows_correct_distribution(self):
      strm = test_util.test_seed_stream()
      prior = inverse_gamma.InverseGamma(concentration=0.1, scale=0.1)
  
      num_timesteps = 100
      observed_samples = (
          tf.random.normal([2, num_timesteps], seed=strm()) * 3.0
      )
      is_missing = (
          tf.random.uniform([2, num_timesteps], seed=strm()) > 0.9
      )
  
      # Check that posterior variance samples have the moments of the correct
      # InverseGamma distribution.
      posterior_scale_samples = tf.vectorized_map(
          lambda seed: gibbs_sampler._resample_scale(  # pylint: disable=g-long-lambda
              prior=prior,
              observed_residuals=observed_samples,
              is_missing=is_missing,
              seed=seed,
          ),
          samplers.split_seed(strm(), tf.constant(10000)),
      )
  
      concentration = (
          prior.concentration
          + tf.reduce_sum(1 - tf.cast(is_missing, tf.float32), axis=-1)
          / 2.0
      )
      scale = (
          prior.scale
          + tf.reduce_sum(
              (observed_samples * tf.cast(~is_missing, tf.float32))
              ** 2,
              axis=-1,
          )
          / 2.0
      )
      posterior_scale_samples_, concentration_, scale_ = self.evaluate(
          (posterior_scale_samples, concentration, scale)
      )
      self.assertAllClose(
          np.mean(posterior_scale_samples_**2, axis=0),
          scale_ / (concentration_ - 1),
          atol=0.05,
      )
      self.assertAllClose(
          np.std(posterior_scale_samples_**2, axis=0),
          scale_ / ((concentration_ - 1) * np.sqrt(concentration_ - 2)),
          atol=0.05,
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import square
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.distributions.linear_gaussian_ssm import linear_gaussian_update
  from tensorflow_probability.python.experimental.distributions import mvn_precision_factor_linop
  from tensorflow_probability.python.experimental.sts_gibbs import gibbs_sampler
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import sample_stats
  from tensorflow_probability.python.sts.components import local_level
  from tensorflow_probability.python.sts.components import local_linear_trend
  from tensorflow_probability.python.sts.components import regression
  from tensorflow_probability.python.sts.components import seasonal
  from tensorflow_probability.python.sts.components import semilocal_linear_trend
  from tensorflow_probability.python.sts.components import sum
  from tensorflow_probability.python.sts.forecast import forecast
  from tensorflow_probability.python.sts.internal import missing_values_util
  from tensorflow_probability.python.sts.internal import util
label_desc: Use image node_id 10 for calling the GibbsSamplerTests obj's underlying member method code with example usage: obj.test_sampled_scale_follows_correct_distribution() without return types