class_docstr: Inherits time series methods from TSM class.
  
  **** GENERALIZED AUTOREGRESSIVE CONDITIONAL HETEROSCEDASTICITY (GARCH) MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.array
      Field to specify the time series data that will be used.
  
  p : int
      Field to specify how many GARCH terms the model will have.
  
  q : int
      Field to specify how many ARCH terms the model will have.
  
  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.
docstr: Computes posterior predictive p-value
  
  Parameters
  ----------
  nsims : int (default : 1000)
      How many draws for the PPC
  
  T : function
      A discrepancy measure - e.g. np.mean, np.std, np.max
  
  Returns
  ----------
  - float (posterior predictive p-value)
docstr_tok: ["Computes","posterior","predictive","p-value","Parameters","--","--","--","--","--","nsims",":","int","(","default",":","1000",")","How","many","draws","for","the","PPC","T",":","function","A","discrepancy","measure","-","e.g",".","np.mean",",","np.std",",","np.max","Returns","--","--","--","--","--","-","float","(","posterior","predictive","p-value",")"]
code: def ppc(self, nsims=1000, T=np.mean):
      """Computes posterior predictive p-value
  
      Parameters
      ----------
      nsims : int (default : 1000)
          How many draws for the PPC
  
      T : function
          A discrepancy measure - e.g. np.mean, np.std, np.max
  
      Returns
      ----------
      - float (posterior predictive p-value)
      """
      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)
          sigmas = [
              self._model(lv_draws[:, i])[0] for i in range(nsims)
          ]
          data_draws = np.array(
              [
                  ss.norm.rvs(
                      loc=self.latent_variables.z_list[
                          -1
                      ].prior.transform(lv_draws[-1, i]),
                      scale=np.sqrt(sigmas[i]),
                  )
                  for i in range(nsims)
              ]
          )
          T_sims = T(self.sample(nsims=nsims), axis=1)
          T_actual = T(self.data)
          return len(T_sims[T_sims > T_actual]) / nsims
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import data_check
  from .garch_recursions import garch_recursion
label_desc: Use image node_id 19 for calling the GARCH obj's underlying member method code with example usage: obj.ppc(nsims, T) and returns: unknown