class_docstr: Inherits time series methods from TSM class.
  
  **** BETA-t-EGARCH IN MEAN REGRESSION MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame
      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.
  
  formula : string
      patsy string describing the regression
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","BETA-t-EGARCH","IN","MEAN","REGRESSION","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","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",".","formula",":","string","patsy","string","describing","the","regression"]
docstr: Simulates a h-step ahead mean prediction
  
  Parameters
  ----------
  lmda : np.array
      The past predicted values
  
  Y : np.array
      The past data
  
  scores : np.array
      The past scores
  
  h : int
      How many steps ahead for the prediction
  
  t_params : np.array
      A vector of (transformed) latent variables
  
  simulations : int
      How many simulations to perform
  
  X_oos : np.array
      Out of sample predictors
  
  Returns
  ----------
  Matrix of simulations
docstr_tok: ["Simulates","a","h-step","ahead","mean","prediction","Parameters","--","--","--","--","--","lmda",":","np.array","The","past","predicted","values","Y",":","np.array","The","past","data","scores",":","np.array","The","past","scores","h",":","int","How","many","steps","ahead","for","the","prediction","t_params",":","np.array","A","vector","of","(","transformed",")","latent","variables","simulations",":","int","How","many","simulations","to","perform","X_oos",":","np.array","Out","of","sample","predictors","Returns","--","--","--","--","--","Matrix","of","simulations"]
code: def _sim_prediction(
      self, lmda, Y, scores, h, t_params, simulations, X_oos
  ):
      """Simulates a h-step ahead mean prediction
  
      Parameters
      ----------
      lmda : np.array
          The past predicted values
  
      Y : np.array
          The past data
  
      scores : np.array
          The past scores
  
      h : int
          How many steps ahead for the prediction
  
      t_params : np.array
          A vector of (transformed) latent variables
  
      simulations : int
          How many simulations to perform
  
      X_oos : np.array
          Out of sample predictors
  
      Returns
      ----------
      Matrix of simulations
      """
  
      sim_vector = np.zeros([simulations, h])
  
      for n in range(0, simulations):
          # Create arrays to iteratre over
          lmda_exp = lmda.copy()
          scores_exp = scores.copy()
          Y_exp = Y.copy()
  
          # Loop over h time periods
          for t in range(0, h):
              new_lambda_value = 0
  
              if self.p != 0:
                  for j in range(self.p):
                      new_lambda_value += t_params[j] * lmda_exp[-j - 1]
  
              if self.q != 0:
                  for k in range(self.q):
                      new_lambda_value += (
                          t_params[k + self.p] * scores_exp[-k - 1]
                      )
  
              if self.leverage is True:
                  new_lambda_value += (
                      t_params[self.p + self.q]
                      * np.sign(-(Y_exp[-1] - new_theta_value))
                      * (scores_exp[-1] + 1)
                  )
  
              new_lambda_value += np.dot(
                  X_oos[t],
                  t_params[-len(self.X_names) * 2 : -len(self.X_names)],
              )
              new_theta_value = np.dot(
                  X_oos[t], t_params[-len(self.X_names) :]
              ) + t_params[-(len(self.X_names) * 2) - 1] * np.exp(
                  new_lambda_value / 2.0
              )
  
              lmda_exp = np.append(
                  lmda_exp, [new_lambda_value]
              )  # For indexing consistency
              scores_exp = np.append(
                  scores_exp, scores[np.random.randint(scores.shape[0])]
              )  # expectation of score is zero
              Y_exp = np.append(
                  Y_exp, Y[np.random.randint(Y.shape[0])]
              )  # bootstrap returns
  
          sim_vector[n] = lmda_exp[-h:]
  
      return np.transpose(sim_vector)
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from patsy import dmatrices, dmatrix, demo_data
  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 6 for calling the EGARCHMReg obj's underlying member method code with example usage: obj._sim_prediction(lmda, Y, scores, h, t_params, simulations, X_oos) and returns: np