class_docstr: Inherits time series methods from TSM class.
  
  **** DYNAMIC AUTOREGRESSIVE MODEL ****
  
  Parameters
  ----------
  
  ar : int
      Number of autoregressive lags
  
  data : pd.DataFrame
      Field to specify the data that will be used
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","DYNAMIC","AUTOREGRESSIVE","MODEL","*","*","*","*","Parameters","--","--","--","--","--","ar",":","int","Number","of","autoregressive","lags","data",":","pd.DataFrame","Field","to","specify","the","data","that","will","be","used"]
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?
  
  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","?","Returns","--","--","--","--","--","-","Plot","of","the","forecast"]
code: def plot_predict(self, h=5, past_values=20, intervals=True, **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?
  
      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:
          y_holder = (
              self.y.copy()
          )  # holds past data and predicted data to create AR matrix
          full_X = self.X.copy()
          full_X = np.append(
              full_X,
              np.array([np.append(1.0, y_holder[-self.ar :][::-1])]),
              axis=0,
          )
          Z = full_X
  
          # Construct Z matrix
          for step in range(h):
              a, P = self._forecast_model(
                  self.latent_variables.get_z_values(), Z, step
              )
              new_value = np.dot(Z[-1, :], a[:, self.y.shape[0] + step])
              y_holder = np.append(y_holder, new_value)
              Z = np.append(
                  Z,
                  np.array(
                      [np.append(1.0, y_holder[-self.ar :][::-1])]
                  ),
                  axis=0,
              )
  
          # Retrieve data, dates and (transformed) latent variables
          a, P = self._forecast_model(
              self.latent_variables.get_z_values(), Z, h
          )
          smoothed_series = np.zeros(self.y.shape[0] + h)
          series_variance = np.zeros(self.y.shape[0] + h)
          for t in range(self.y.shape[0] + h):
              smoothed_series[t] = np.dot(Z[t], a[:, t])
              series_variance[t] = np.dot(
                  np.dot(Z[t], P[:, :, t]), Z[t].T
              ) + self.latent_variables.z_list[0].prior.transform(
                  self.latent_variables.get_z_values()[0]
              )
  
          date_index = self.shift_dates(h)
          plot_values = smoothed_series[-h - past_values :]
          forecasted_values = smoothed_series[-h:]
          lower = forecasted_values - 1.98 * np.power(
              series_variance[-h:], 0.5
          )
          upper = forecasted_values + 1.98 * np.power(
              series_variance[-h:], 0.5
          )
          lower = np.append(plot_values[-h - 1], lower)
          upper = np.append(plot_values[-h - 1], upper)
  
          plot_index = date_index[-h - past_values :]
  
          plt.figure(figsize=figsize)
          if intervals == True:
              plt.fill_between(
                  date_index[-h - 1 :], lower, upper, alpha=0.2
              )
  
          plt.plot(plot_index, plot_values)
          plt.title("Forecast for " + self.y_name)
          plt.xlabel("Time")
          plt.ylabel(self.y_name)
          plt.show()
  
imports: import copy
  import sys
  import numpy
  import pandas
  import scipy.stats
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .kalman import *
label_desc: Use image node_id 8 for calling the DAR obj's underlying member method code with example usage: obj.plot_predict(h, past_values, intervals) without return types