class_docstr: Inherits time series methods from TSM class.
  
  **** LOCAL LINEAR TREND MODEL ****
  
  Parameters
  ----------
  data : pd.DataFrame or np.array
      Field to specify the time series data that will be used.
  
  integ : int (default : 0)
      Specifies how many time to difference the time series.
  
  target : str (pd.DataFrame) or int (np.array)
      Specifies which column name or array index to use. By default, first
      column/array will be selected as the dependent variable.
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","LOCAL","LINEAR","TREND","MODEL","*","*","*","*","Parameters","--","--","--","--","--","data",":","pd.DataFrame","or","np.array","Field","to","specify","the","time","series","data","that","will","be","used",".","integ",":","int","(","default",":","0",")","Specifies","how","many","time","to","difference","the","time","series",".","target",":","str","(","pd.DataFrame",")","or","int","(","np.array",")","Specifies","which","column","name","or","array","index","to","use",".","By","default",",","first","column\/array","will","be","selected","as","the","dependent","variable","."]
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 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","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 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))
      nsims = kwargs.get("nsims", 200)
  
      if self.latent_variables.estimated is False:
          raise Exception("No latent variables estimated!")
      else:
          # Retrieve data, dates and (transformed) latent variables
          if self.latent_variables.estimation_method in ["M-H"]:
              lower_final = 0
              upper_final = 0
              plot_values_final = 0
              date_index = self.shift_dates(h)
              plot_index = date_index[-h - past_values :]
  
              for i in range(nsims):
                  t_params = self.draw_latent_variables(nsims=1).T[0]
                  a, P = self._forecast_model(t_params, h)
  
                  plot_values = a[0][-h - past_values :]
                  forecasted_values = a[0][-h:]
  
                  lower = forecasted_values - 1.96 * np.power(
                      P[0][0][-h:]
                      + self.latent_variables.z_list[0].prior.transform(
                          t_params[0]
                      ),
                      0.5,
                  )
                  upper = forecasted_values + 1.96 * np.power(
                      P[0][0][-h:]
                      + self.latent_variables.z_list[0].prior.transform(
                          t_params[0]
                      ),
                      0.5,
                  )
                  lower_final += np.append(plot_values[-h - 1], lower)
                  upper_final += np.append(plot_values[-h - 1], upper)
                  plot_values_final += plot_values
  
              plot_values_final = plot_values_final / nsims
              lower_final = lower_final / nsims
              upper_final = upper_final / nsims
  
              plt.figure(figsize=figsize)
              if intervals == True:
                  plt.fill_between(
                      date_index[-h - 1 :],
                      lower_final,
                      upper_final,
                      alpha=0.2,
                  )
  
              plt.plot(plot_index, plot_values_final)
              plt.title("Forecast for " + self.data_name)
              plt.xlabel("Time")
              plt.ylabel(self.data_name)
              plt.show()
          else:
              a, P = self._forecast_model(
                  self.latent_variables.get_z_values(), h
              )
              date_index = self.shift_dates(h)
              plot_values = a[0][-h - past_values :]
              forecasted_values = a[0][-h:]
  
              lower = forecasted_values - 1.96 * np.power(
                  P[0][0][-h:]
                  + self.latent_variables.z_list[0].prior.transform(
                      self.latent_variables.get_z_values()[0]
                  ),
                  0.5,
              )
              upper = forecasted_values + 1.96 * np.power(
                  P[0][0][-h:]
                  + self.latent_variables.z_list[0].prior.transform(
                      self.latent_variables.get_z_values()[0]
                  ),
                  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.data_name)
              plt.xlabel("Time")
              plt.ylabel(self.data_name)
              plt.show()
  
imports: import copy
  import sys
  import numpy
  import pandas
  import scipy.stats
  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 LLT obj's underlying member method code with example usage: obj.plot_predict(h, past_values, intervals) without return types