code: def ar_explicit_logp(y, coefs, level_scale):
      """Manual log-prob computation for an autoregressive process."""
      num_coefs = len(coefs)
      lp = 0.0
  
      # For the first few steps of y, where previous values
      # are not available, we model them as zero-mean with
      # stddev `prior_scale`.
      for i in range(num_coefs):
          zero_padded_y = np.zeros([num_coefs])
          zero_padded_y[num_coefs - i : num_coefs] = y[:i]
          pred_y = np.dot(zero_padded_y, coefs[::-1])
          lp += normal.Normal(pred_y, level_scale).log_prob(y[i])
  
      for i in range(num_coefs, len(y)):
          pred_y = np.dot(y[i - num_coefs : i], coefs[::-1])
          lp += normal.Normal(pred_y, level_scale).log_prob(y[i])
  
      return lp
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.sts.components.autoregressive import AutoregressiveStateSpaceModel
  from tensorflow_probability.python.sts.components.local_level import LocalLevelStateSpaceModel
label_desc: Use image node_id 1 for calling a global function with example usage: ar_explicit_logp(y, coefs, level_scale) and returns: lp