class_docstr: LatentVariable Class
  
  Parameters
  ----------
  name : str
      Name of the latent variable
  
  index : int
      Index of the latent variable
  
  prior : Prior object
      The prior for the latent variable, e.g. Normal(0,1)
  
  q : fam.[dist] object
      The variational distribution for the latent variable, e.g. Normal(0,1)
code: def plot_z(self, figsize=(15, 5)):
      import matplotlib.pyplot as plt
      import seaborn as sns
  
      if hasattr(self, "sample"):
          sns.distplot(
              self.prior.transform(self.sample),
              rug=False,
              hist=False,
              label=self.method + " estimate of " + self.name,
          )
  
      elif hasattr(self, "value") and hasattr(self, "std"):
          x = np.linspace(
              self.value - self.std * 3.5,
              self.value + self.std * 3.5,
              100,
          )
          plt.figure(figsize=figsize)
          if self.prior.transform_name is None:
              plt.plot(
                  x,
                  mlab.normpdf(x, self.value, self.std),
                  label=self.method + " estimate of " + self.name,
              )
          else:
              sims = self.prior.transform(
                  np.random.normal(self.value, self.std, 100000)
              )
              sns.distplot(
                  sims,
                  rug=False,
                  hist=False,
                  label=self.method + " estimate of " + self.name,
              )
          plt.xlabel("Value")
          plt.legend()
          plt.show()
  
      else:
          raise ValueError("No information on latent variable to plot!")
  
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 2 for calling the LatentVariable obj's underlying member method code with example usage: obj.plot_z(figsize) without return types