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 creates shocks based on desired specification
  
  Parameters
  ----------
  h : int
      How many steps ahead to 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 variables 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 h-length list which contains np.arrays containing shocks for each variable
docstr_tok: ["Function","creates","shocks","based","on","desired","specification","Parameters","--","--","--","--","--","h",":","int","How","many","steps","ahead","to","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","variables","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","h-length","list","which","contains","np.arrays","containing","shocks","for","each","variable"]
code: def _shock_create(
      self,
      h,
      shock_type,
      shock_index,
      shock_value,
      shock_dir,
      irf_intervals,
  ):
      """Function creates shocks based on desired specification
  
      Parameters
      ----------
      h : int
          How many steps ahead to 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 variables 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 h-length list which contains np.arrays containing shocks for each variable
      """
  
      if shock_type is None:
          random = [np.zeros(self.ylen) for i in range(0, h)]
  
      elif shock_type == "IRF":
          if self.use_ols_covariance is False:
              cov = self.custom_covariance(
                  self.latent_variables.get_z_values()
              )
          else:
              cov = self.ols_covariance()
  
          post = ss.multivariate_normal(np.zeros(self.ylen), cov)
  
          if irf_intervals is False:
              random = [np.zeros(self.ylen) for i in range(0, h)]
          else:
              random = [post.rvs() for i in range(0, h)]
              random[0] = np.zeros(self.ylen)
  
          if shock_value is None:
              if shock_dir == "positive":
                  random[0][shock_index] = (
                      cov[shock_index, shock_index] ** 0.5
                  )
              elif shock_dir == "negative":
                  random[0][shock_index] = (
                      -cov[shock_index, shock_index] ** 0.5
                  )
              else:
                  raise ValueError("Unknown shock direction!")
          else:
              random[0][shock_index] = shock_value
  
      elif shock_type == "Cov":
          if self.use_ols_covariance is False:
              cov = self.custom_covariance(
                  self.latent_variables.get_z_values()
              )
          else:
              cov = self.ols_covariance()
  
          post = ss.multivariate_normal(np.zeros(self.ylen), cov)
          random = [post.rvs() for i in range(0, h)]
  
      return random
  
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 8 for calling the VAR obj's underlying member method code with example usage: obj._shock_create(h, shock_type, shock_index, shock_value, shock_dir, irf_intervals) and returns: random