code: def _mean_prediction(self, sigma2, Y, scores, h, t_params):
               
  
          # Create arrays to iteratre over
          sigma2_exp = sigma2.copy()
          scores_exp = scores.copy()
  
          # Loop over h time periods          
          for t in range(0,h):
              new_value = t_params[0]
  
              # ARCH
              if self.q != 0:
                  for j in range(1,self.q+1):
                      new_value += t_params[j]*scores_exp[-j]
  
              # GARCH
              if self.p != 0:
                  for k in range(1,self.p+1):
                      new_value += t_params[k+self.q]*sigma2_exp[-k]                  
  
              sigma2_exp = np.append(sigma2_exp,[new_value]) # For indexing consistency
              scores_exp = np.append(scores_exp,[0]) # expectation of score is zero
  
          return sigma2_exp
docs: Creates a h-step ahead mean prediction
  
          Parameters
          ----------
          sigma2 : 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
  
          Returns
          ----------
          h-length vector of mean predictions