class_docstr: Poisson Distribution
  ----
  This class contains methods relating to the Poisson distribution for time series.
docstr: Creates approximating Gaussian model for Poisson measurement density
  - dynamic regression model
  
  Parameters
  ----------
  beta : np.array
      Contains untransformed starting values for latent variables
  
  T, Z, R, Q : np.array
      State space matrices used in KFS algorithm
  
  data: np.array
      The univariate time series data
  
  X: np.array
      The regressors
  
  state_no : int
      Number of states
  
  Returns
  ----------
  
  H : np.array
      Approximating measurement variance matrix
  
  mu : np.array
      Approximating measurement constants
docstr_tok: ["Creates","approximating","Gaussian","model","for","Poisson","measurement","density","-","dynamic","regression","model","Parameters","--","--","--","--","--","beta",":","np.array","Contains","untransformed","starting","values","for","latent","variables","T",",","Z",",","R",",","Q",":","np.array","State","space","matrices","used","in","KFS","algorithm","data",":","np.array","The","univariate","time","series","data","X",":","np.array","The","regressors","state_no",":","int","Number","of","states","Returns","--","--","--","--","--","H",":","np.array","Approximating","measurement","variance","matrix","mu",":","np.array","Approximating","measurement","constants"]
code: def approximating_model_reg(
      self, beta, T, Z, R, Q, h_approx, data, X, state_no
  ):
      """Creates approximating Gaussian model for Poisson measurement density
      - dynamic regression model
  
      Parameters
      ----------
      beta : np.array
          Contains untransformed starting values for latent variables
  
      T, Z, R, Q : np.array
          State space matrices used in KFS algorithm
  
      data: np.array
          The univariate time series data
  
      X: np.array
          The regressors
  
      state_no : int
          Number of states
  
      Returns
      ----------
  
      H : np.array
          Approximating measurement variance matrix
  
      mu : np.array
          Approximating measurement constants
      """
  
      H = np.ones(data.shape[0])
      mu = np.zeros(data.shape[0])
  
      alpha = np.zeros([state_no, data.shape[0]])
      tol = 100.0
      it = 0
      while tol > 10**-7 and it < 5:
          old_alpha = np.sum(X * alpha.T, axis=1)
          alpha, V = nld_univariate_KFS(data, Z, H, T, Q, R, mu)
          H = np.exp(-np.sum(X * alpha.T, axis=1))
          mu = (
              data
              - np.sum(X * alpha.T, axis=1)
              - np.exp(-np.sum(X * alpha.T, axis=1))
              * (data - np.exp(np.sum(X * alpha.T, axis=1)))
          )
          tol = np.mean(np.abs(np.sum(X * alpha.T, axis=1) - old_alpha))
          it += 1
  
      return H, mu
  
imports: import numpy
  import scipy.stats
  import scipy.special
  from .poisson_kalman_recursions import nl_univariate_KFS, nld_univariate_KFS
  from .family import Family
  from .flat import Flat
  from .normal import Normal
  from .gas_recursions import gas_recursion_poisson_orderone, gas_recursion_poisson_ordertwo
  from .gas_recursions import gasx_recursion_poisson_orderone, gasx_recursion_poisson_ordertwo
  from .gas_recursions import gas_llev_recursion_poisson_orderone, gas_llev_recursion_poisson_ordertwo
  from .gas_recursions import gas_llt_recursion_poisson_orderone, gas_llt_recursion_poisson_ordertwo
  from .gas_recursions import gas_reg_recursion_poisson_orderone, gas_reg_recursion_poisson_ordertwo
label_desc: Use image node_id 3 for calling the Poisson obj's underlying member method code with example usage: obj.approximating_model_reg(beta, T, Z, R, Q, h_approx, data, X, state_no) and returns: H,  mu