class_docstr: Inherits time series methods from TSM class.
  
  **** LONG MEMORY BETA-t-EGARCH MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.array
      Field to specify the time series data that will be used.
  
  p : int
      Field to specify how many GARCH terms the model will have.
  
  q : int
      Field to specify how many SCORE terms the model will have.
  
  target : str (pd.DataFrame) or int (np.array)
      Specifies which column name or array index to use. By default, first
      column/array will be selected as the dependent variable.
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","LONG","MEMORY","BETA-t-EGARCH","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","or","np.array","Field","to","specify","the","time","series","data","that","will","be","used",".","p",":","int","Field","to","specify","how","many","GARCH","terms","the","model","will","have",".","q",":","int","Field","to","specify","how","many","SCORE","terms","the","model","will","have",".","target",":","str","(","pd.DataFrame",")","or","int","(","np.array",")","Specifies","which","column","name","or","array","index","to","use",".","By","default",",","first","column\/array","will","be","selected","as","the","dependent","variable","."]
docstr: Creates the structure of the model
  
  Parameters
  ----------
  beta : np.array
      Contains untransformed starting values for latent variables
  
  Returns
  ----------
  lambda : np.array
      Contains the values for the conditional volatility series
  
  Y : np.array
      Contains the length-adjusted time series (accounting for lags)
  
  scores : np.array
      Contains the score terms for the time series
docstr_tok: ["Creates","the","structure","of","the","model","Parameters","--","--","--","--","--","beta",":","np.array","Contains","untransformed","starting","values","for","latent","variables","Returns","--","--","--","--","--","lambda",":","np.array","Contains","the","values","for","the","conditional","volatility","series","Y",":","np.array","Contains","the","length-adjusted","time","series","(","accounting","for","lags",")","scores",":","np.array","Contains","the","score","terms","for","the","time","series"]
code: def _mb_model(self, beta, mini_batch):
      """Creates the structure of the model
  
      Parameters
      ----------
      beta : np.array
          Contains untransformed starting values for latent variables
  
      Returns
      ----------
      lambda : np.array
          Contains the values for the conditional volatility series
  
      Y : np.array
          Contains the length-adjusted time series (accounting for lags)
  
      scores : np.array
          Contains the score terms for the time series
      """
  
      # Transform latent variables
      parm = np.array(
          [
              self.latent_variables.z_list[k].prior.transform(beta[k])
              for k in range(beta.shape[0])
          ]
      )
  
      rand_int = np.random.randint(
          low=0, high=self.data_length - mini_batch + 1
      )
      sample = np.arange(start=rand_int, stop=rand_int + mini_batch)
      sampled_data = self.data[sample]
  
      Y = np.array(sampled_data[self.max_lag :])
      X = np.ones(Y.shape[0])
      scores = np.zeros(Y.shape[0])
      lmda = np.ones(Y.shape[0]) * parm[0]
      lmda_c = np.zeros((Y.shape[0], 2))
  
      # Loop over time series
      for t in range(0, Y.shape[0]):
          if t >= self.max_lag:
              for comp in range(2):
                  # Loop over GARCH terms
                  for p_term in range(0, self.p):
                      lmda_c[t, comp] += (
                          parm[1 + p_term + (comp * (self.q + self.p))]
                          * lmda_c[t - p_term - 1, comp]
                      )
  
                  # Loop over Score terms
                  for q_term in range(0, self.q):
                      lmda_c[t, comp] += (
                          parm[
                              1
                              + self.p
                              + q_term
                              + (comp * (self.q + self.p))
                          ]
                          * scores[t - q_term - 1]
                      )
  
              if self.leverage is True:
                  lmda_c[t, 1] += (
                      parm[-3]
                      * np.sign(-(Y[t - 1] - parm[-1]))
                      * (scores[t - 1] + 1)
                  )
  
              lmda[t] += lmda_c[t, :].sum()
  
          else:
              lmda[t] = parm[0] / (1 - parm[1 : 1 + self.p].sum())
  
          scores[t] = (
              ((parm[-2] + 1.0) * np.power(Y[t] - parm[-1], 2))
              / float(
                  parm[-2] * np.exp(lmda[t])
                  + np.power(Y[t] - parm[-1], 2)
              )
          ) - 1.0
  
      return lmda, lmda_c, Y, scores
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import gas
  from ..None import data_check
label_desc: Use image node_id 4 for calling the LMEGARCH obj's underlying member method code with example usage: obj._mb_model(beta, mini_batch) and returns: lmda,  lmda_c,  Y,  scores