code: def autoregressive_series_markov_chain(
      num_timesteps, mean, noise_scale, persistence, name
  ):
      return tfd.MarkovChain(
          initial_state_prior=tfd.Normal(
              loc=mean,
              scale=noise_scale
              / tf.math.sqrt(tf.ones([]) - persistence**2),
          ),
          transition_fn=lambda _, x_t: tfd.Normal(  # pylint: disable=g-long-lambda
              loc=persistence * (x_t - mean) + mean, scale=noise_scale
          ),
          num_steps=num_timesteps,
          name=name,
      )
  
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 2 for calling a global function with example usage: autoregressive_series_markov_chain(num_timesteps, mean, noise_scale, persistence, name) and returns: tfd