class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE SCORE (GAS) REGRESSION MODELS ****
  
  Parameters
  ----------
  
  formula : string
      patsy string describing the regression
  
  data : pd.DataFrame or np.array
      Field to specify the data that will be used
  
  family : GAS family object
      Which distribution to use, e.g. GASNormal()
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","GENERALIZED","AUTOREGRESSIVE","SCORE","(","GAS",")","REGRESSION","MODELS","*","*","*","*","Parameters","--","--","--","--","--","formula",":","string","patsy","string","describing","the","regression","data",":","pd.DataFrame","or","np.array","Field","to","specify","the","data","that","will","be","used","family",":","GAS","family","object","Which","distribution","to","use",",","e.g",".","GASNormal","(",")"]
docstr: Samples from the posterior predictive distribution
  
  Parameters
  ----------
  nsims : int (default : 1000)
      How many draws from the posterior predictive distribution
  
  Returns
  ----------
  - np.ndarray of draws from the data
docstr_tok: ["Samples","from","the","posterior","predictive","distribution","Parameters","--","--","--","--","--","nsims",":","int","(","default",":","1000",")","How","many","draws","from","the","posterior","predictive","distribution","Returns","--","--","--","--","--","-","np.ndarray","of","draws","from","the","data"]
code: def sample(self, nsims=1000):
      """Samples from the posterior predictive distribution
  
      Parameters
      ----------
      nsims : int (default : 1000)
          How many draws from the posterior predictive distribution
  
      Returns
      ----------
      - np.ndarray of draws from the data
      """
      if self.latent_variables.estimation_method not in ["BBVI", "M-H"]:
          raise Exception("No latent variables estimated!")
      else:
          lv_draws = self.draw_latent_variables(nsims=nsims)
          mus = [self._model(lv_draws[:, i])[0] for i in range(nsims)]
          (
              model_scale,
              model_shape,
              model_skewness,
          ) = self._get_scale_and_shape_sim(lv_draws)
          data_draws = np.array(
              [
                  self.family.draw_variable(
                      self.link(mus[i]),
                      np.repeat(model_scale[i], mus[i].shape[0]),
                      np.repeat(model_shape[i], mus[i].shape[0]),
                      np.repeat(model_skewness[i], mus[i].shape[0]),
                      mus[i].shape[0],
                  )
                  for i in range(nsims)
              ]
          )
          return data_draws
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .gas_core_recursions import gas_reg_recursion
label_desc: Use image node_id 18 for calling the GASReg obj's underlying member method code with example usage: obj.sample(nsims) and returns: data_draws