class_docstr: Inherits time series methods from TSM class.
  
  **** NON-GAUSSIAN DYNAMIC REGRESSION MODELS ****
  
  Parameters
  ----------
  
  formula : string
      patsy string describing the regression
  
  data : pd.DataFrame
      Field to specify the data that will be used
  
  family : 
      e.g. pf.Normal(0,1)
docstr: Plots the fit of the model
  
  Parameters
  ----------
  intervals : Boolean
      Whether to plot 95% confidence interval of states
  
  Returns
  ----------
  None (plots data and the fit)
docstr_tok: ["Plots","the","fit","of","the","model","Parameters","--","--","--","--","--","intervals",":","Boolean","Whether","to","plot","95","%","confidence","interval","of","states","Returns","--","--","--","--","--","None","(","plots","data","and","the","fit",")"]
code: def plot_fit(self, intervals=True, **kwargs):
      """Plots the fit of the model
  
      Parameters
      ----------
      intervals : Boolean
          Whether to plot 95% confidence interval of states
  
      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 = copy.deepcopy(self.index)
          date_index = date_index[: self.y.shape[0] + 1]
  
          mu = self.states
          var = self.states_var
          # Create smoothed/filtered aggregate series
          _, Z, _, _ = self._ss_matrices(
              self.latent_variables.get_z_values()
          )
          smoothed_series = np.zeros(self.y.shape[0])
  
          for t in range(0, self.y.shape[0]):
              smoothed_series[t] = np.dot(Z[t], mu[:, t])
  
          plt.figure(figsize=figsize)
  
          plt.subplot(self.state_no + 1, 1, 1)
          plt.title(self.y_name + " Raw and Smoothed")
          plt.plot(date_index, self.data, label="Data")
          plt.plot(
              date_index,
              self.link(smoothed_series),
              label="Smoothed Series",
              c="black",
          )
          plt.legend(loc=2)
  
          for coef in range(0, self.state_no):
              V_coef = self.states_var[coef]
              plt.subplot(self.state_no + 1, 1, 2 + coef)
              plt.title("Beta " + self.X_names[coef])
              states_upper_95 = self.states[coef] + 1.98 * np.sqrt(
                  V_coef
              )
              states_lower_95 = self.states[coef] - 1.98 * np.sqrt(
                  V_coef
              )
  
              if intervals == True:
                  alpha = [
                      0.15 * i / float(100) for i in range(50, 12, -2)
                  ]
                  plt.fill_between(
                      date_index,
                      states_lower_95,
                      states_upper_95,
                      alpha=0.15,
                      label="95% C.I.",
                  )
  
              plt.plot(date_index, mu[coef, :], label="Coefficient")
              plt.legend(loc=2)
  
          plt.show()
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  from scipy import optimize
  from ..None import inference
  from ..None import families
  from ..None import output
  from ..None import tsm
  from ..None import data_check
  from ..None import covariances
  from ..None import results
  from ..None import gas
  from .kalman import *
  from .dynlin import *
label_desc: Use image node_id 20 for calling the NDynReg obj's underlying member method code with example usage: obj.plot_fit(intervals) without return types