class_docstr: Inherits time series methods from TSM parent class.
  
  **** AUTOREGRESSIVE INTEGRATED MOVING AVERAGE EXOGENOUS (ARIMAX) MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame
      Field to specify the univariate time series data that will be used.
  
  formula : string
      patsy string notation describing the regression
  
  ar : int
      Field to specify how many AR lags the model will have.
  
  ma : int
      Field to specify how many MA lags the model will have.
  
  integ : int (default : 0)
      Specifies how many times to difference the time series.
  
  family : family object
      E.g pf.Normal(), pf.t(), pf.Laplace()...
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","parent","class",".","*","*","*","*","AUTOREGRESSIVE","INTEGRATED","MOVING","AVERAGE","EXOGENOUS","(","ARIMAX",")","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","Field","to","specify","the","univariate","time","series","data","that","will","be","used",".","formula",":","string","patsy","string","notation","describing","the","regression","ar",":","int","Field","to","specify","how","many","AR","lags","the","model","will","have",".","ma",":","int","Field","to","specify","how","many","MA","lags","the","model","will","have",".","integ",":","int","(","default",":","0",")","Specifies","how","many","times","to","difference","the","time","series",".","family",":","family","object","E.g","pf.Normal","(",")",",","pf.t","(",")",",","pf.Laplace","(",")","..."]
docstr: Creates a h-step ahead mean prediction
  
  This function is used for predict(). We have to iterate over the number
  of timepoints (h) that the user wants to predict, using as inputs the ARIMA
  parameters, past datapoints, past predicted datapoints, and assumptions about
  future exogenous variables (X_oos).
  
  Parameters
  ----------
  mu : np.array
      The past predicted values
  
  Y : np.array
      The past data
  
  h : int
      How many steps ahead for the prediction
  
  t_z : np.array
      A vector of (transformed) latent variables
  
  X_oos : np.array
      Out of sample X data
  
  Returns
  ----------
  h-length vector of mean predictions
docstr_tok: ["Creates","a","h-step","ahead","mean","prediction","This","function","is","used","for","predict","(",")",".","We","have","to","iterate","over","the","number","of","timepoints","(","h",")","that","the","user","wants","to","predict",",","using","as","inputs","the","ARIMA","parameters",",","past","datapoints",",","past","predicted","datapoints",",","and","assumptions","about","future","exogenous","variables","(","X_oos",")",".","Parameters","--","--","--","--","--","mu",":","np.array","The","past","predicted","values","Y",":","np.array","The","past","data","h",":","int","How","many","steps","ahead","for","the","prediction","t_z",":","np.array","A","vector","of","(","transformed",")","latent","variables","X_oos",":","np.array","Out","of","sample","X","data","Returns","--","--","--","--","--","h-length","vector","of","mean","predictions"]
code: def _mean_prediction(self, mu, Y, h, t_z, X_oos):
      """Creates a h-step ahead mean prediction
  
      This function is used for predict(). We have to iterate over the number
      of timepoints (h) that the user wants to predict, using as inputs the ARIMA
      parameters, past datapoints, past predicted datapoints, and assumptions about
      future exogenous variables (X_oos).
  
      Parameters
      ----------
      mu : np.array
          The past predicted values
  
      Y : np.array
          The past data
  
      h : int
          How many steps ahead for the prediction
  
      t_z : np.array
          A vector of (transformed) latent variables
  
      X_oos : np.array
          Out of sample X data
  
      Returns
      ----------
      h-length vector of mean predictions
      """
  
      # Create arrays to iterate over
      Y_exp = Y.copy()
      mu_exp = mu.copy()
  
      # Loop over h time periods
      for t in range(0, h):
          new_value = 0
          if self.ar != 0:
              for j in range(0, self.ar):
                  new_value += t_z[j] * Y_exp[-j - 1]
  
          if self.ma != 0:
              for k in range(0, self.ma):
                  if k >= t:
                      new_value += t_z[k + self.ar] * (
                          Y_exp[-k - 1] - mu_exp[-k - 1]
                      )
  
          # X terms
          new_value += np.matmul(
              X_oos[t, :],
              t_z[
                  self.ma
                  + self.ar : (self.ma + self.ar + len(self.X_names))
              ],
          )
  
          if self.model_name2 == "Exponential":
              Y_exp = np.append(Y_exp, [1.0 / self.link(new_value)])
          else:
              Y_exp = np.append(Y_exp, [self.link(new_value)])
  
          mu_exp = np.append(mu_exp, [0])  # For indexing consistency
  
      return Y_exp
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  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 data_check
  from .arma_recursions import arimax_recursion
label_desc: Use image node_id 10 for calling the ARIMAX obj's underlying member method code with example usage: obj._mean_prediction(mu, Y, h, t_z, X_oos) and returns: Y_exp