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: Plots the fit of the model
  
  Notes
  ----------
  Intervals are bootstrapped as follows: take the filtered values from the
  algorithm (thetas). Use these thetas to generate a pseudo data stream from
  the measurement density. Use the GAS algorithm and estimated latent variables to
  filter the pseudo data. Repeat this N times. 
  
  Returns
  ----------
  None (plots data and the fit)
docstr_tok: ["Plots","the","fit","of","the","model","Notes","--","--","--","--","--","Intervals","are","bootstrapped","as","follows",":","take","the","filtered","values","from","the","algorithm","(","thetas",")",".","Use","these","thetas","to","generate","a","pseudo","data","stream","from","the","measurement","density",".","Use","the","GAS","algorithm","and","estimated","latent","variables","to","filter","the","pseudo","data",".","Repeat","this","N","times",".","Returns","--","--","--","--","--","None","(","plots","data","and","the","fit",")"]
code: def plot_fit(self, **kwargs):
      """Plots the fit of the model
  
      Notes
      ----------
      Intervals are bootstrapped as follows: take the filtered values from the
      algorithm (thetas). Use these thetas to generate a pseudo data stream from
      the measurement density. Use the GAS algorithm and estimated latent variables to
      filter the pseudo data. Repeat this N times.
  
      Returns
      ----------
      None (plots data and the fit)
      """
      import matplotlib.pyplot as plt
      import seaborn as sns
  
      figsize = kwargs.get("figsize", (10, 7))
  
      if self.latent_variables.estimated is False:
          raise Exception("No latent variables estimated!")
      else:
          date_index = self.index.copy()
          mu, Y, scores, coefficients = self._model(
              self.latent_variables.get_z_values()
          )
  
          if self.model_name2 == "Exponential":
              values_to_plot = 1.0 / self.link(mu)
          elif self.model_name2 == "Skewt":
              t_params = self.transform_z()
              (
                  model_scale,
                  model_shape,
                  model_skewness,
              ) = self._get_scale_and_shape(t_params)
              m1 = (
                  np.sqrt(model_shape)
                  * sp.gamma((model_shape - 1.0) / 2.0)
              ) / (np.sqrt(np.pi) * sp.gamma(model_shape / 2.0))
              additional_loc = (
                  (model_skewness - (1.0 / model_skewness))
                  * model_scale
                  * m1
              )
              values_to_plot = mu + additional_loc
          else:
              values_to_plot = self.link(mu)
  
          plt.figure(figsize=figsize)
  
          plt.subplot(len(self.X_names) + 1, 1, 1)
          plt.title(self.y_name + " Filtered")
          plt.plot(date_index, Y, label="Data")
          plt.plot(
              date_index, values_to_plot, label="GAS Filter", c="black"
          )
          plt.legend(loc=2)
  
          for coef in range(0, len(self.X_names)):
              plt.subplot(len(self.X_names) + 1, 1, 2 + coef)
              plt.title("Beta " + self.X_names[coef])
              plt.plot(
                  date_index,
                  coefficients[coef, 0:-1],
                  label="Coefficient",
              )
              plt.legend(loc=2)
  
          plt.show()
  
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 13 for calling the GASReg obj's underlying member method code with example usage: obj.plot_fit() without return types