class_docstr: TSM PARENT CLASS
  
  Contains general time series methods to be inherited by models.
  
  Parameters
  ----------
  model_type : str
      The type of model (e.g. 'ARIMA', 'GARCH')
class_docstr_tok: ["TSM","PARENT","CLASS","Contains","general","time","series","methods","to","be","inherited","by","models",".","Parameters","--","--","--","--","--","model_type",":","str","The","type","of","model","(","e.g",".","'ARIMA","'",",","'GARCH","'",")"]
docstr: Draws latent variables from the model (for Bayesian inference)
  
  Parameters
  ----------
  nsims : int
      How many draws to take
  
  Returns
  ----------
  - np.ndarray of draws
docstr_tok: ["Draws","latent","variables","from","the","model","(","for","Bayesian","inference",")","Parameters","--","--","--","--","--","nsims",":","int","How","many","draws","to","take","Returns","--","--","--","--","--","-","np.ndarray","of","draws"]
code: def draw_latent_variables(self, nsims=5000):
      """Draws latent variables from the model (for Bayesian inference)
  
      Parameters
      ----------
      nsims : int
          How many draws to take
  
      Returns
      ----------
      - np.ndarray of draws
      """
      if self.latent_variables.estimation_method is None:
          raise Exception("No latent variables estimated!")
      elif self.latent_variables.estimation_method == "BBVI":
          return np.array(
              [
                  i.q.draw_variable_local(size=nsims)
                  for i in self.latent_variables.z_list
              ]
          )
      elif self.latent_variables.estimation_method == "M-H":
          chain = np.array(
              [
                  self.latent_variables.z_list[i].sample
                  for i in range(len(self.latent_variables.z_list))
              ]
          )
          return chain[:, np.random.choice(chain.shape[1], nsims)]
      else:
          raise Exception(
              "No latent variables estimated through Bayesian inference"
          )
  
imports: from math import exp, sqrt, log, tanh
  import copy
  import sys
  import warnings
  import numpy
  from scipy import optimize
  import numdifftools
  import pandas
  from .covariances import acf
  from .families import Normal
  from .inference import BBVI, BBVIM, MetropolisHastings, norm_post_sim
  from .output import TablePrinter
  from .tests import find_p_value
  from .latent_variables import LatentVariable, LatentVariables
  from .results import BBVIResults, MLEResults, LaplaceResults, MCMCResults
label_desc: Use image node_id 18 for calling the TSM obj's underlying member method code with example usage: obj.draw_latent_variables(nsims) and returns: np, chain