code: def autoregressive_series_fn(
      num_timesteps, mean, noise_scale, persistence
  ):
      """Generative process for an order-1 autoregressive process."""
      x_t = yield Root(
          tfd.Normal(
              loc=mean,
              scale=noise_scale
              / tf.math.sqrt(tf.ones([]) - persistence**2),
              name="x_{:06d}".format(0),
          )
      )
      for t in range(1, num_timesteps):
          # The 'centered' representation used here is challenging for inference
          # algorithms. A noncentered representation would be easier, but no one ever
          # achieved greatness by doing only easy things.
          x_t = yield tfd.Normal(
              loc=mean + persistence * (x_t - mean),
              scale=noise_scale,
              name="x_{:06d}".format(t),
          )
  
imports: import collections
  import functools
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.python.internal import prefer_static
  from inference_gym.internal import data
  from inference_gym.targets import bayesian_model
  from inference_gym.targets import model
  from inference_gym.targets.ground_truth import stochastic_volatility_sp500
  from inference_gym.targets.ground_truth import stochastic_volatility_sp500_small
label_desc: Use image node_id 1 for calling a global function with example usage: autoregressive_series_fn(num_timesteps, mean, noise_scale, persistence) without return types