code: def make_ar_transition_matrix(coefficients):
      """Build transition matrix for an autoregressive StateSpaceModel.
  
      When applied to a vector of previous values, this matrix computes
      the expected new value (summing the previous states according to the
      autoregressive coefficients) in the top dimension of the state space,
      and moves all previous values down by one dimension, 'forgetting' the
      final (least recent) value. That is, it looks like this:
  
      ```
      ar_matrix = [ coefs[0], coefs[1], ..., coefs[order]
                    1.,       0 ,       ..., 0.
                    0.,       1.,       ..., 0.
                    ...
                    0.,       0.,  ..., 1.,  0.            ]
      ```
  
      Args:
        coefficients: float `Tensor` of shape `concat([batch_shape, [order]])`.
  
      Returns:
        ar_matrix: float `Tensor` with shape `concat([batch_shape,
        [order, order]])`.
      """
  
      top_row = tf.expand_dims(coefficients, -2)
      coef_shape = dist_util.prefer_static_shape(coefficients)
      batch_shape, order = coef_shape[:-1], coef_shape[-1]
      remaining_rows = tf.concat(
          [
              tf.eye(
                  order - 1,
                  dtype=coefficients.dtype,
                  batch_shape=batch_shape,
              ),
              tf.zeros(
                  ps.concat([batch_shape, (order - 1, 1)], axis=0),
                  dtype=coefficients.dtype,
              ),
          ],
          axis=-1,
      )
      ar_matrix = tf.concat([top_row, remaining_rows], axis=-2)
      return ar_matrix
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.bijectors import tanh
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.sts.internal import util
  from tensorflow_probability.python.sts.structural_time_series import Parameter
  from tensorflow_probability.python.sts.structural_time_series import StructuralTimeSeries
label_desc: Use image node_id 1 for calling a global function with example usage: make_ar_transition_matrix(coefficients) and returns: ar_matrix