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: Makes forecast with the estimated model
  
  Parameters
  ----------
  h : int (default : 5)
      How many steps ahead would you like to forecast?
  
  past_values : int (default : 20)
      How many past observations to show on the forecast graph?
  
  intervals : Boolean
      Would you like to show 95% prediction intervals for the forecast?
  
  oos_data : pd.DataFrame
      OOS data to use; needs to be same format (columns) as original data
  
  Returns
  ----------
  - Plot of the forecast
docstr_tok: ["Makes","forecast","with","the","estimated","model","Parameters","--","--","--","--","--","h",":","int","(","default",":","5",")","How","many","steps","ahead","would","you","like","to","forecast","?","past_values",":","int","(","default",":","20",")","How","many","past","observations","to","show","on","the","forecast","graph","?","intervals",":","Boolean","Would","you","like","to","show","95","%","prediction","intervals","for","the","forecast","?","oos_data",":","pd.DataFrame","OOS","data","to","use",";","needs","to","be","same","format","(","columns",")","as","original","data","Returns","--","--","--","--","--","-","Plot","of","the","forecast"]
code: def plot_predict(
      self, h=5, past_values=20, intervals=True, oos_data=None, **kwargs
  ):
      """Makes forecast with the estimated model
  
      Parameters
      ----------
      h : int (default : 5)
          How many steps ahead would you like to forecast?
  
      past_values : int (default : 20)
          How many past observations to show on the forecast graph?
  
      intervals : Boolean
          Would you like to show 95% prediction intervals for the forecast?
  
      oos_data : pd.DataFrame
          OOS data to use; needs to be same format (columns) as original data
  
      Returns
      ----------
      - Plot of the forecast
      """
      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:
          # Retrieve data, dates and (transformed) latent variables
          scale, shape, skewness = self._get_scale_and_shape(
              self.latent_variables.get_z_values(transformed=True)
          )
  
          # Retrieve data, dates and (transformed) latent variables
          date_index = self.shift_dates(h)
          simulations = 10000
          sim_vector = np.zeros([simulations, h])
  
          _, X_oos = dmatrices(self.formula, oos_data)
          X_oos = np.array([X_oos])[0]
          full_X = self.X.copy()
          full_X = np.append(full_X, X_oos, axis=0)
          Z = full_X
          a = self.states
  
          # Retrieve data, dates and (transformed) latent variables
          smoothed_series = np.zeros(h)
          for t in range(h):
              smoothed_series[t] = self.link(
                  np.dot(Z[self.y.shape[0] + t], a[:, -1])
              )
  
          for n in range(0, simulations):
              rnd_q = np.zeros((self.state_no, h))
              coeff_sim = np.zeros((self.state_no, h))
  
              # TO DO: vectorize this (easy)
              for state in range(self.state_no):
                  rnd_q[state] = np.random.normal(
                      0,
                      np.sqrt(
                          self.latent_variables.get_z_values(
                              transformed=True
                          )[state]
                      ),
                      h,
                  )
  
              for t in range(0, h):
                  if t == 0:
                      for state in range(self.state_no):
                          coeff_sim[state][t] = (
                              a[state][-1] + rnd_q[state][t]
                          )
                  else:
                      for state in range(self.state_no):
                          coeff_sim[state][t] = (
                              coeff_sim[state][t - 1] + rnd_q[state][t]
                          )
  
              sim_vector[n] = self.family.draw_variable(
                  loc=self.link(
                      np.sum(
                          coeff_sim.T
                          * Z[self.y.shape[0] : self.y.shape[0] + h, :],
                          axis=1,
                      )
                  ),
                  shape=shape,
                  scale=scale,
                  skewness=skewness,
                  nsims=h,
              )
  
          sim_vector = np.transpose(sim_vector)
          forecasted_values = smoothed_series
          previous_value = self.data[-1]
  
          plt.figure(figsize=figsize)
  
          if intervals == True:
              plt.fill_between(
                  date_index[-h - 1 :],
                  np.insert(
                      [np.percentile(i, 5) for i in sim_vector],
                      0,
                      previous_value,
                  ),
                  np.insert(
                      [np.percentile(i, 95) for i in sim_vector],
                      0,
                      previous_value,
                  ),
                  alpha=0.2,
                  label="95 C.I.",
              )
  
          plot_values = np.append(
              self.data[-past_values:], forecasted_values
          )
          plot_index = date_index[-h - past_values :]
  
          plt.plot(plot_index, plot_values, label=self.data_name)
          plt.title("Forecast for " + self.data_name)
          plt.xlabel("Time")
          plt.ylabel(self.data_name)
          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 19 for calling the NDynReg obj's underlying member method code with example usage: obj.plot_predict(h, past_values, intervals, oos_data) without return types