class_docstr: Inherits time series methods from TSM class.
  
  **** VECTOR AUTOREGRESSION (VAR) MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.array
      Field to specify the time series data that will be used.
  
  lags : int
      Field to specify how many lag terms the model will have. 
  
  integ : int (default : 0)
      Specifies how many time to difference the dependent variables.
  
  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.
  
  use_ols_covariance : Boolean
      If true use OLS covariance; if false use estimated covariance
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","VECTOR","AUTOREGRESSION","(","VAR",")","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","or","np.array","Field","to","specify","the","time","series","data","that","will","be","used",".","lags",":","int","Field","to","specify","how","many","lag","terms","the","model","will","have",".","integ",":","int","(","default",":","0",")","Specifies","how","many","time","to","difference","the","dependent","variables",".","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",".","use_ols_covariance",":","Boolean","If","true","use","OLS","covariance",";","if","false","use","estimated","covariance"]
docstr: Function allows for mean prediction; also allows shock specification for simulations or impulse response effects
  
  Parameters
  ----------
  h : int
      How many steps ahead to forecast
  
  t_params : np.array
      Transformed latent variables vector
  
  Y : np.array
      Data for series that is being forecast
  
  shock_type : None or str
      Type of shock; options include None, 'Cov' (simulate from covariance matrix), 'IRF' (impulse response shock)
  
  shock_index : int
      Which latent variable to apply the shock to if using an IRF.
  
  shock_value : None or float
      If specified, applies a custom-sized impulse response shock.
  
  shock_dir : str
      Direction of the IRF shock. One of 'positive' or 'negative'.
  
  irf_intervals : Boolean
      Whether to have intervals for the IRF plot or not
  
  Returns
  ----------
  A vector of forecasted data
docstr_tok: ["Function","allows","for","mean","prediction",";","also","allows","shock","specification","for","simulations","or","impulse","response","effects","Parameters","--","--","--","--","--","h",":","int","How","many","steps","ahead","to","forecast","t_params",":","np.array","Transformed","latent","variables","vector","Y",":","np.array","Data","for","series","that","is","being","forecast","shock_type",":","None","or","str","Type","of","shock",";","options","include","None",",","'Cov","'","(","simulate","from","covariance","matrix",")",",","'IRF","'","(","impulse","response","shock",")","shock_index",":","int","Which","latent","variable","to","apply","the","shock","to","if","using","an","IRF",".","shock_value",":","None","or","float","If","specified",",","applies","a","custom-sized","impulse","response","shock",".","shock_dir",":","str","Direction","of","the","IRF","shock",".","One","of","'positive","'","or","'negative","'",".","irf_intervals",":","Boolean","Whether","to","have","intervals","for","the","IRF","plot","or","not","Returns","--","--","--","--","--","A","vector","of","forecasted","data"]
code: def _forecast_mean(
      self,
      h,
      t_params,
      Y,
      shock_type=None,
      shock_index=0,
      shock_value=None,
      shock_dir="positive",
      irf_intervals=False,
  ):
      """Function allows for mean prediction; also allows shock specification for simulations or impulse response effects
  
      Parameters
      ----------
      h : int
          How many steps ahead to forecast
  
      t_params : np.array
          Transformed latent variables vector
  
      Y : np.array
          Data for series that is being forecast
  
      shock_type : None or str
          Type of shock; options include None, 'Cov' (simulate from covariance matrix), 'IRF' (impulse response shock)
  
      shock_index : int
          Which latent variable to apply the shock to if using an IRF.
  
      shock_value : None or float
          If specified, applies a custom-sized impulse response shock.
  
      shock_dir : str
          Direction of the IRF shock. One of 'positive' or 'negative'.
  
      irf_intervals : Boolean
          Whether to have intervals for the IRF plot or not
  
      Returns
      ----------
      A vector of forecasted data
      """
  
      random = self._shock_create(
          h,
          shock_type,
          shock_index,
          shock_value,
          shock_dir,
          irf_intervals,
      )
      exp = [Y[variable] for variable in range(0, self.ylen)]
  
      # Each forward projection
      for t in range(0, h):
          new_values = np.zeros(self.ylen)
  
          # Each variable
          for variable in range(0, self.ylen):
              index_ref = variable * (1 + self.ylen * self.lags)
              new_values[variable] = t_params[index_ref]  # constant
  
              # VAR(p) terms
              for lag in range(0, self.lags):
                  for lagged_var in range(0, self.ylen):
                      new_values[variable] += (
                          t_params[
                              index_ref
                              + lagged_var
                              + (lag * self.ylen)
                              + 1
                          ]
                          * exp[lagged_var][-1 - lag]
                      )
  
              # Random shock
              new_values[variable] += random[t][variable]
  
          # Add new values
          for variable in range(0, self.ylen):
              exp[variable] = np.append(
                  exp[variable], new_values[variable]
              )
  
      return np.array(exp)
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import datetime
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import data_check
  from .var_recursions import create_design_matrix, custom_covariance_matrix, var_likelihood
label_desc: Use image node_id 6 for calling the VAR obj's underlying member method code with example usage: obj._forecast_mean(h, t_params, Y, shock_type, shock_index, shock_value, shock_dir, irf_intervals) and returns: np