class_docstr: Inherits time series methods from TSM class.
  
  **** BETA-t-EGARCH IN MEAN REGRESSION MODELS ****
  
  Parameters
  ----------
  data : pd.DataFrame
      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 SCORE terms the model will have.
  
  formula : string
      patsy string describing the regression
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","BETA-t-EGARCH","IN","MEAN","REGRESSION","MODELS","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","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","SCORE","terms","the","model","will","have",".","formula",":","string","patsy","string","describing","the","regression"]
docstr: Plots histogram of the discrepancy from draws of the posterior
  
  Parameters
  ----------
  nsims : int (default : 1000)
      How many draws for the PPC
  
  T : function
      A discrepancy measure - e.g. np.mean, np.std, np.max
docstr_tok: ["Plots","histogram","of","the","discrepancy","from","draws","of","the","posterior","Parameters","--","--","--","--","--","nsims",":","int","(","default",":","1000",")","How","many","draws","for","the","PPC","T",":","function","A","discrepancy","measure","-","e.g",".","np.mean",",","np.std",",","np.max"]
code: def plot_ppc(self, nsims=1000, T=np.mean, **kwargs):
      """Plots histogram of the discrepancy from draws of the posterior
  
      Parameters
      ----------
      nsims : int (default : 1000)
          How many draws for the PPC
  
      T : function
          A discrepancy measure - e.g. np.mean, np.std, np.max
      """
      if self.latent_variables.estimation_method not in ["BBVI", "M-H"]:
          raise Exception("No latent variables estimated!")
      else:
          import matplotlib.pyplot as plt
          import seaborn as sns
  
          figsize = kwargs.get("figsize", (10, 7))
  
          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.t.rvs(
                      loc=self.latent_variables.z_list[
                          -len(self.X_names) * 2 - 1
                      ].prior.transform(
                          lv_draws[-len(self.X_names) * 2 - 1, i]
                      ),
                      df=self.latent_variables.z_list[
                          -len(self.X_names) * 2 - 2
                      ].prior.transform(
                          lv_draws[-len(self.X_names) * 2 - 2, i]
                      ),
                      scale=np.exp(sigmas[i] / 2.0),
                  )
                  for i in range(nsims)
              ]
          )
          T_sim = T(self.sample(nsims=nsims), axis=1)
          T_actual = T(self.data)
  
          if T == np.mean:
              description = " of the mean"
          elif T == np.max:
              description = " of the maximum"
          elif T == np.min:
              description = " of the minimum"
          elif T == np.median:
              description = " of the median"
          else:
              description = ""
  
          plt.figure(figsize=figsize)
          ax = plt.subplot()
          ax.axvline(T_actual)
          sns.distplot(T_sim, kde=False, ax=ax)
          ax.set(
              title="Posterior predictive" + description,
              xlabel="T(x)",
              ylabel="Frequency",
          )
          plt.show()
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import gas
  from ..None import data_check
label_desc: Use image node_id 21 for calling the EGARCHMReg obj's underlying member method code with example usage: obj.plot_ppc(nsims, T) without return types