def __init__(self,<EOL>order,<EOL>coefficients_prior=None,<EOL>level_scale_prior=None,<EOL>initial_state_prior=None,<EOL>coefficient_constraining_bijector=None,<EOL>observed_time_series=None,<EOL>name=None):
with tf.compat.v1.name_scope(<EOL>name, '<STR_LIT>', values=[observed_time_series]) as name:<EOL><INDENT>masked_time_series = None<EOL>if observed_time_series is not None:<EOL><INDENT>masked_time_series = (<EOL>sts_util.canonicalize_observed_time_series_with_mask(<EOL>observed_time_series))<EOL><DEDENT>dtype = dtype_util.common_dtype(<EOL>[(masked_time_series.time_series<EOL>if masked_time_series is not None else None),<EOL>coefficients_prior,<EOL>level_scale_prior,<EOL>initial_state_prior], preferred_dtype=tf.float32)<EOL>if observed_time_series is not None:<EOL><INDENT>_, observed_stddev, observed_initial = sts_util.empirical_statistics(<EOL>masked_time_series)<EOL><DEDENT>else:<EOL><INDENT>observed_stddev, observed_initial = (<EOL>tf.convert_to_tensor(value=<NUM_LIT:1.>, dtype=dtype),<EOL>tf.convert_to_tensor(value=<NUM_LIT:0.>, dtype=dtype))<EOL><DEDENT>batch_ones = tf.ones(tf.concat([<EOL>tf.shape(input=observed_initial),  <EOL>[order]], axis=<NUM_LIT:0>), dtype=dtype)<EOL>if coefficients_prior is None:<EOL><INDENT>coefficients_prior = tfd.MultivariateNormalDiag(<EOL>scale_diag=batch_ones)<EOL><DEDENT>if level_scale_prior is None:<EOL><INDENT>level_scale_prior = tfd.LogNormal(<EOL>loc=tf.math.log(<NUM_LIT> *  observed_stddev), scale=<NUM_LIT>)<EOL><DEDENT>if (coefficients_prior.event_shape.is_fully_defined() and<EOL>order != coefficients_prior.event_shape[<NUM_LIT:0>]):<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>coefficients_prior.event_shape[<NUM_LIT:0>], order))<EOL><DEDENT>if initial_state_prior is None:<EOL><INDENT>initial_state_prior = tfd.MultivariateNormalDiag(<EOL>loc=observed_initial[..., tf.newaxis] * batch_ones,<EOL>scale_diag=(tf.abs(observed_initial) +<EOL>observed_stddev)[..., tf.newaxis] * batch_ones)<EOL><DEDENT>self._order = order<EOL>self._coefficients_prior = coefficients_prior<EOL>self._level_scale_prior = level_scale_prior<EOL>self._initial_state_prior = initial_state_prior<EOL>if coefficient_constraining_bijector is None:<EOL><INDENT>coefficient_constraining_bijector = tfb.Tanh()<EOL><DEDENT>super(Autoregressive, self).__init__(<EOL>parameters=[<EOL>Parameter('<STR_LIT>',<EOL>coefficients_prior,<EOL>coefficient_constraining_bijector),<EOL>Parameter('<STR_LIT>', level_scale_prior, tfb.Softplus())<EOL>],<EOL>latent_size=order,<EOL>name=name)<EOL><DEDENT>
Specify an autoregressive model.

        Args:
          order: scalar Python positive `int` specifying the number of past
            timesteps to regress on.
          coefficients_prior: optional `tfd.Distribution` instance specifying a
            prior on the `coefficients` parameter. If `None`, a default standard
            normal (`tfd.MultivariateNormalDiag(scale_diag=tf.ones([order]))`) prior
            is used.
            Default value: `None`.
          level_scale_prior: optional `tfd.Distribution` instance specifying a prior
            on the `level_scale` parameter. If `None`, a heuristic default prior is
            constructed based on the provided `observed_time_series`.
            Default value: `None`.
          initial_state_prior: optional `tfd.Distribution` instance specifying a
            prior on the initial state, corresponding to the values of the process
            at a set of size `order` of imagined timesteps before the initial step.
            If `None`, a heuristic default prior is constructed based on the
            provided `observed_time_series`.
            Default value: `None`.
          coefficient_constraining_bijector: optional `tfb.Bijector` instance
            representing a constraining mapping for the autoregressive coefficients.
            For example, `tfb.Tanh()` constrains the coefficients to lie in
            `(-1, 1)`, while `tfb.Softplus()` constrains them to be positive, and
            `tfb.Identity()` implies no constraint. If `None`, the default behavior
            constrains the coefficients to lie in `(-1, 1)` using a `Tanh` bijector.
            Default value: `None`.
          observed_time_series: optional `float` `Tensor` of shape
            `batch_shape + [T, 1]` (omitting the trailing unit dimension is also
            supported when `T > 1`), specifying an observed time series.
            Any priors not explicitly set will be given default values according to
            the scale of the observed time series (or batch of time series). May
            optionally be an instance of `tfp.sts.MaskedTimeSeries`, which includes
            a mask `Tensor` to specify timesteps with missing observations.
            Default value: `None`.
          name: the name of this model component.
            Default value: 'Autoregressive'.