code: def test_day_of_week_example(self):
      # Test that the Seasonal SSM is equivalent to individually modeling
      # a random walk on each season's slice of timesteps.
  
      seed = test_util.test_seed(sampler_type="stateless")
      drift_scale = 0.6
      observation_noise_scale = 0.1
  
      day_of_week = SeasonalStateSpaceModel(
          num_timesteps=28,
          num_seasons=7,
          drift_scale=self._build_placeholder(drift_scale),
          observation_noise_scale=observation_noise_scale,
          initial_state_prior=mvn_diag.MultivariateNormalDiag(
              scale_diag=self._build_placeholder(np.ones([7]))
          ),
          num_steps_per_season=1,
      )
  
      random_walk_model = (
          linear_gaussian_ssm.LinearGaussianStateSpaceModel(
              num_timesteps=4,
              transition_matrix=self._build_placeholder([[1.0]]),
              transition_noise=mvn_diag.MultivariateNormalDiag(
                  scale_diag=self._build_placeholder([drift_scale])
              ),
              observation_matrix=self._build_placeholder([[1.0]]),
              observation_noise=mvn_diag.MultivariateNormalDiag(
                  scale_diag=self._build_placeholder(
                      [observation_noise_scale]
                  )
              ),
              initial_state_prior=mvn_diag.MultivariateNormalDiag(
                  scale_diag=self._build_placeholder([1.0])
              ),
          )
      )
  
      sampled_time_series = day_of_week.sample(seed=seed)
      (
          sampled_time_series_,
          total_lp_,
          prior_mean_,
          prior_variance_,
      ) = self.evaluate(
          [
              sampled_time_series,
              day_of_week.log_prob(sampled_time_series),
              day_of_week.mean(),
              day_of_week.variance(),
          ]
      )
  
      expected_daily_means_, expected_daily_variances_ = self.evaluate(
          [random_walk_model.mean(), random_walk_model.variance()]
      )
  
      # For the (noncontiguous) indices corresponding to each season, assert
      # that the model's mean, variance, and log_prob match a random-walk model.
      daily_lps = []
      for day_idx in range(7):
          self.assertAllClose(
              prior_mean_[day_idx::7], expected_daily_means_
          )
          self.assertAllClose(
              prior_variance_[day_idx::7], expected_daily_variances_
          )
  
          daily_lps.append(
              self.evaluate(
                  random_walk_model.log_prob(
                      sampled_time_series_[day_idx::7]
                  )
              )
          )
  
      self.assertAlmostEqual(total_lp_, sum(daily_lps), places=3)
  
imports: import math
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  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 categorical
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.sts.components.seasonal import ConstrainedSeasonalStateSpaceModel
  from tensorflow_probability.python.sts.components.seasonal import Seasonal
  from tensorflow_probability.python.sts.components.seasonal import SeasonalStateSpaceModel
label_desc: Use image node_id 1 for calling the _SeasonalStateSpaceModelTest obj's underlying member method code with example usage: obj.test_day_of_week_example() without return types