code: def gen_data_for_model3():
      # Starting values
      alpha1_0 = 2.1
      alpha2_0 = 1.1
  
      t_max = 500
  
      def gen_i(alpha1, s):
          return (
              alpha1 * s
              + np.sqrt(true_values["var_e1"]) * np.random.randn()
          )
  
      def gen_m_hat(alpha2):
          return (
              1 * alpha2
              + np.sqrt(true_values["var_e2"]) * np.random.randn()
          )
  
      def gen_alpha1(alpha1, alpha2):
          w1 = np.sqrt(true_values["var_w1"]) * np.random.randn()
          return (
              true_values["delta1"] * alpha1
              + true_values["delta2"] * alpha2
              + w1
          )
  
      def gen_alpha2(alpha2):
          w2 = np.sqrt(true_values["var_w2"]) * np.random.randn()
          return true_values["delta3"] * alpha2 + w2
  
      s_t = 0.3 + np.sqrt(1.4) * np.random.randn(t_max)
      i_hat = np.empty(t_max)
      m_hat = np.empty(t_max)
  
      current_alpha1 = alpha1_0
      current_alpha2 = alpha2_0
      for t in range(t_max):
          # Obs eqns
          i_hat[t] = gen_i(current_alpha1, s_t[t])
          m_hat[t] = gen_m_hat(current_alpha2)
  
          # state eqns
          new_alpha1 = gen_alpha1(current_alpha1, current_alpha2)
          new_alpha2 = gen_alpha2(current_alpha2)
  
          # Update states for next period
          current_alpha1 = new_alpha1
          current_alpha2 = new_alpha2
  
      return i_hat, m_hat, s_t
  
imports: from collections import OrderedDict
  import matplotlib.pyplot
  import numpy
  import pandas
  import statsmodels.api
  import pymc3
  import theano
  import theano.tensor
label_desc: Use image node_id 2 for calling a global function with example usage: gen_data_for_model3() and returns: i_hat,  m_hat,  s_t, unknown, unknown, unknown, unknown