code: def _mb_non_normal_model(self, beta, mini_batch):
               
  
          rand_int =  np.random.randint(low=0, high=self.data_length-mini_batch-self.max_lag+1)
          sample = np.arange(start=rand_int, stop=rand_int+mini_batch)
  
          Y = self.data[self.max_lag:][sample]
          X = self.X[:, sample]
  
          # Transform latent variables
          z = np.array([self.latent_variables.z_list[k].prior.transform(beta[k]) for k in range(beta.shape[0])])
  
          # Constant and AR terms
          if self.ar != 0:
              mu = np.matmul(np.transpose(X),z[:-self.family_z_no-self.ma])
          else:
              mu = np.ones(Y.shape[0])*z[0]
              
          # MA terms
          if self.ma != 0:
              mu = arima_recursion(z, mu, self.link(mu), Y, self.max_lag, Y.shape[0], self.ar, self.ma)
  
          return mu, Y
docs: Creates the structure of the model (model matrices etc) for mini batch model
  
          Here the structure is the same as for _non_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)