class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE CONDITIONAL HETEROSCEDASTICITY (GARCH) 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 ARCH 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 (model matrices etc) for mini batch model.
  
  Here the structure is the same as for _normal_model() but we are going to
  sample a random choice of data points (of length mini_batch).
  
  Parameters
  ----------
  beta : np.ndarray
      Contains untransformed starting values for the latent variables
  
  mini_batch : int
      Mini batch size for the data sampling
  
  Returns
  ----------
  mu : np.ndarray
      Contains the predicted values (location) for the time series
  
  Y : np.ndarray
      Contains the length-adjusted time series (accounting for lags)
docstr_tok: ["Creates","the","structure","of","the","model","(","model","matrices","etc",")","for","mini","batch","model",".","Here","the","structure","is","the","same","as","for","_normal_model","(",")","but","we","are","going","to","sample","a","random","choice","of","data","points","(","of","length","mini_batch",")",".","Parameters","--","--","--","--","--","beta",":","np.ndarray","Contains","untransformed","starting","values","for","the","latent","variables","mini_batch",":","int","Mini","batch","size","for","the","data","sampling","Returns","--","--","--","--","--","mu",":","np.ndarray","Contains","the","predicted","values","(","location",")","for","the","time","series","Y",":","np.ndarray","Contains","the","length-adjusted","time","series","(","accounting","for","lags",")"]
code: def _mb_model(self, beta, mini_batch):
      """Creates the structure of the model (model matrices etc) for mini batch model.
  
      Here the structure is the same as for _normal_model() but we are going to
      sample a random choice of data points (of length mini_batch).
  
      Parameters
      ----------
      beta : np.ndarray
          Contains untransformed starting values for the latent variables
  
      mini_batch : int
          Mini batch size for the data sampling
  
      Returns
      ----------
      mu : np.ndarray
          Contains the predicted values (location) for the time series
  
      Y : np.ndarray
          Contains the length-adjusted time series (accounting for lags)
      """
  
      # 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]
  
      xeps = np.power(sampled_data - parm[-1], 2)
      Y = np.array(sampled_data[self.max_lag :])
      eps = np.power(Y - parm[-1], 2)
      X = np.ones(Y.shape[0])
  
      # ARCH terms
      if self.q != 0:
          for i in range(0, self.q):
              X = np.vstack((X, xeps[(self.max_lag - i - 1) : -i - 1]))
          sigma2 = np.matmul(np.transpose(X), parm[0 : -self.p - 1])
      else:
          sigma2 = np.transpose(X * parm[0])
  
      sigma2 = garch_recursion(
          parm, sigma2, self.q, self.p, Y.shape[0], self.max_lag
      )
  
      return np.array(sigma2), Y, eps
  
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 data_check
  from .garch_recursions import garch_recursion
label_desc: Use image node_id 4 for calling the GARCH obj's underlying member method code with example usage: obj._mb_model(beta, mini_batch) and returns: np,  Y,  eps