class_docstr: Latent Variables Class
  
  Holds latent variable objects and contains method for latent variable manipulation. Latent variables are 
  referred to as z as shorthand. This is convention in much of the literature.
docstr: Adds latent variable
  
  Parameters
  ----------
  name : str
      Name of the latent variable
  
  prior : Prior object
      Which prior distribution? E.g. Normal(0,1)
  
  q : Distribution object
      Which distribution to use for variational approximation
  
  index : boolean
      Whether to index the variable in the z_indices dictionary
  
  Returns
  ----------
  None (changes priors in LatentVariables object)
docstr_tok: ["Adds","latent","variable","Parameters","--","--","--","--","--","name",":","str","Name","of","the","latent","variable","prior",":","Prior","object","Which","prior","distribution","?","E.g",".","Normal","(","0,1",")","q",":","Distribution","object","Which","distribution","to","use","for","variational","approximation","index",":","boolean","Whether","to","index","the","variable","in","the","z_indices","dictionary","Returns","--","--","--","--","--","None","(","changes","priors","in","LatentVariables","object",")"]
code: def add_z(self, name, prior, q, index=True):
      """Adds latent variable
  
      Parameters
      ----------
      name : str
          Name of the latent variable
  
      prior : Prior object
          Which prior distribution? E.g. Normal(0,1)
  
      q : Distribution object
          Which distribution to use for variational approximation
  
      index : boolean
          Whether to index the variable in the z_indices dictionary
  
      Returns
      ----------
      None (changes priors in LatentVariables object)
      """
  
      self.z_list.append(
          LatentVariable(name, len(self.z_list), prior, q)
      )
      if index is True:
          self.z_indices[name] = {
              "start": len(self.z_list) - 1,
              "end": len(self.z_list) - 1,
          }
  
imports: import numpy
  import pandas
  from .covariances import acf
  from .output import TablePrinter
  from .inference import *
  from .families import Normal, t, TruncatedNormal, Cauchy, Skewt, InverseGamma, Flat, InverseWishart, Laplace
label_desc: Use image node_id 3 for calling the LatentVariables obj's underlying member method code with example usage: obj.add_z(name, prior, q, index) without return types