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: Creates model latent variables
  
  Returns
  ----------
  None (changes model attributes)
docstr_tok: ["Creates","model","latent","variables","Returns","--","--","--","--","--","None","(","changes","model","attributes",")"]
code: def _create_latent_variables(self):
      """Creates model latent variables
  
      Returns
      ----------
      None (changes model attributes)
      """
  
      # TODO: There must be a cleaner way to do this below
  
      # Create VAR latent variables
      for variable in range(self.ylen):
          self.latent_variables.add_z(
              self.data_name[variable] + " Constant",
              fam.Normal(0, 3, transform=None),
              fam.Normal(0, 3),
          )
          other_variables = np.delete(range(self.ylen), [variable])
          for lag_no in range(self.lags):
              self.latent_variables.add_z(
                  str(self.data_name[variable])
                  + " AR("
                  + str(lag_no + 1)
                  + ")",
                  fam.Normal(0, 0.5, transform=None),
                  fam.Normal(0, 3),
              )
              for other in other_variables:
                  self.latent_variables.add_z(
                      str(self.data_name[other])
                      + " to "
                      + str(self.data_name[variable])
                      + " AR("
                      + str(lag_no + 1)
                      + ")",
                      fam.Normal(0, 0.5, transform=None),
                      fam.Normal(0, 3),
                  )
  
      starting_params_temp = self._create_B_direct().flatten()
  
      # Variance latent variables
      for i in range(self.ylen):
          for k in range(self.ylen):
              if i == k:
                  self.latent_variables.add_z(
                      "Cholesky Diagonal " + str(i),
                      fam.Flat(transform="exp"),
                      fam.Normal(0, 3),
                  )
              elif i > k:
                  self.latent_variables.add_z(
                      "Cholesky Off-Diagonal ("
                      + str(i)
                      + ","
                      + str(k)
                      + ")",
                      fam.Flat(transform=None),
                      fam.Normal(0, 3),
                  )
  
      for i in range(0, self.ylen):
          for k in range(0, self.ylen):
              if i == k:
                  starting_params_temp = np.append(
                      starting_params_temp, np.array([0.5])
                  )
              elif i > k:
                  starting_params_temp = np.append(
                      starting_params_temp, np.array([0.0])
                  )
  
      self.latent_variables.set_z_starting_values(starting_params_temp)
  
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 4 for calling the VAR obj's underlying member method code with example usage: obj._create_latent_variables() without return types