docstr: SemiLocalLinearTrend with trivial AR process is a LocalLinearTrend.
docstr_tok: ["SemiLocalLinearTrend","with","trivial","AR","process","is","a","LocalLinearTrend","."]
code: def test_matches_locallineartrend(self):
      """SemiLocalLinearTrend with trivial AR process is a LocalLinearTrend."""
  
      level_scale = self._build_placeholder(0.5)
      slope_scale = self._build_placeholder(0.5)
      initial_level = self._build_placeholder(3.0)
      initial_slope = self._build_placeholder(-2.0)
      num_timesteps = 5
      y = self._build_placeholder([1.0, 2.5, 4.3, 6.1, 7.8])
  
      semilocal_ssm = SemiLocalLinearTrendStateSpaceModel(
          num_timesteps=num_timesteps,
          level_scale=level_scale,
          slope_scale=slope_scale,
          slope_mean=self._build_placeholder(0.0),
          autoregressive_coef=self._build_placeholder(1.0),
          initial_state_prior=mvn_diag.MultivariateNormalDiag(
              loc=[initial_level, initial_slope],
              scale_diag=self._build_placeholder([1.0, 1.0]),
          ),
      )
  
      local_ssm = LocalLinearTrendStateSpaceModel(
          num_timesteps=num_timesteps,
          level_scale=level_scale,
          slope_scale=slope_scale,
          initial_state_prior=mvn_diag.MultivariateNormalDiag(
              loc=[initial_level, initial_slope],
              scale_diag=self._build_placeholder([1.0, 1.0]),
          ),
      )
  
      semilocal_lp = semilocal_ssm.log_prob(y[:, tf.newaxis])
      local_lp = local_ssm.log_prob(y[:, tf.newaxis])
      self.assertAllClose(
          self.evaluate(semilocal_lp), self.evaluate(local_lp)
      )
  
      semilocal_mean = semilocal_ssm.mean()
      local_mean = local_ssm.mean()
      self.assertAllClose(
          self.evaluate(semilocal_mean), self.evaluate(local_mean)
      )
  
      semilocal_variance = semilocal_ssm.variance()
      local_variance = local_ssm.variance()
      self.assertAllClose(
          self.evaluate(semilocal_variance),
          self.evaluate(local_variance),
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.sts.components.local_linear_trend import LocalLinearTrendStateSpaceModel
  from tensorflow_probability.python.sts.components.semilocal_linear_trend import SemiLocalLinearTrendStateSpaceModel
label_desc: Use image node_id 2 for calling the _SemiLocalLinearTrendStateSpaceModelTest obj's underlying member method code with example usage: obj.test_matches_locallineartrend() without return types