code: def stochastic_volatility_log_likelihood_fn(
      values, centered_returns, use_markov_chain
  ):
      """Likelihood of observed returns under the hypothesized volatilities."""
      log_volatility = (
          values[-1]
          if use_markov_chain
          else tf.stack(values[-1], axis=-1)
      )
      likelihood = tfd.Normal(
          loc=0.0, scale=tf.exp(log_volatility / 2.0)
      )
      return tf.reduce_sum(
          likelihood.log_prob(centered_returns), axis=-1
      )
  
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 4 for calling a global function with example usage: stochastic_volatility_log_likelihood_fn(values, centered_returns, use_markov_chain) and returns: tf