class_docstr: Class to hold results from fitting a recursive least squares model.
  
  Parameters
  ----------
  model : RecursiveLS instance
      The fitted model instance
  
  Attributes
  ----------
  specification : dictionary
      Dictionary including all attributes from the recursive least squares
      model instance.
  
  See Also
  --------
  statsmodels.tsa.statespace.kalman_filter.FilterResults
  statsmodels.tsa.statespace.mlemodel.MLEResults
class_docstr_tok: ["Class","to","hold","results","from","fitting","a","recursive","least","squares","model",".","Parameters","--","--","--","--","--","model",":","RecursiveLS","instance","The","fitted","model","instance","Attributes","--","--","--","--","--","specification",":","dictionary","Dictionary","including","all","attributes","from","the","recursive","least","squares","model","instance",".","See","Also","--","--","--","--","statsmodels.tsa.statespace.kalman_filter.FilterResults","statsmodels.tsa.statespace.mlemodel.MLEResults"]
docstr: Plot the recursively estimated coefficients on a given variable
  
  Parameters
  ----------
  variables : {int, str, list[int], list[str]}, optional
      Integer index or string name of the variable whose coefficient will
      be plotted. Can also be an iterable of integers or strings. Default
      is the first variable.
  alpha : float, optional
      The confidence intervals for the coefficient are (1 - alpha) %
  legend_loc : str, optional
      The location of the legend in the plot. Default is upper left.
  fig : Figure, optional
      If given, subplots are created in this figure instead of in a new
      figure. Note that the grid will be created in the provided
      figure using `fig.add_subplot()`.
  figsize : tuple, optional
      If a figure is created, this argument allows specifying a size.
      The tuple is (width, height).
  
  Notes
  -----
  All plots contain (1 - `alpha`) %  confidence intervals.
docstr_tok: ["Plot","the","recursively","estimated","coefficients","on","a","given","variable","Parameters","--","--","--","--","--","variables",":","{","int",",","str",",","list","[","int","]",",","list","[","str","]","}",",","optional","Integer","index","or","string","name","of","the","variable","whose","coefficient","will","be","plotted",".","Can","also","be","an","iterable","of","integers","or","strings",".","Default","is","the","first","variable",".","alpha",":","float",",","optional","The","confidence","intervals","for","the","coefficient","are","(","1","-","alpha",")","%","legend_loc",":","str",",","optional","The","location","of","the","legend","in","the","plot",".","Default","is","upper","left",".","fig",":","Figure",",","optional","If","given",",","subplots","are","created","in","this","figure","instead","of","in","a","new","figure",".","Note","that","the","grid","will","be","created","in","the","provided","figure","using","`","fig.add_subplot","(",")","`",".","figsize",":","tuple",",","optional","If","a","figure","is","created",",","this","argument","allows","specifying","a","size",".","The","tuple","is","(","width",",","height",")",".","Notes","--","--","-","All","plots","contain","(","1","-","`","alpha","`",")","%","confidence","intervals","."]
code: def plot_recursive_coefficient(
      self,
      variables=0,
      alpha=0.05,
      legend_loc="upper left",
      fig=None,
      figsize=None,
  ):
      r"""
      Plot the recursively estimated coefficients on a given variable
  
      Parameters
      ----------
      variables : {int, str, list[int], list[str]}, optional
          Integer index or string name of the variable whose coefficient will
          be plotted. Can also be an iterable of integers or strings. Default
          is the first variable.
      alpha : float, optional
          The confidence intervals for the coefficient are (1 - alpha) %
      legend_loc : str, optional
          The location of the legend in the plot. Default is upper left.
      fig : Figure, optional
          If given, subplots are created in this figure instead of in a new
          figure. Note that the grid will be created in the provided
          figure using `fig.add_subplot()`.
      figsize : tuple, optional
          If a figure is created, this argument allows specifying a size.
          The tuple is (width, height).
  
      Notes
      -----
      All plots contain (1 - `alpha`) %  confidence intervals.
      """
      # Get variables
      if isinstance(variables, (int, str)):
          variables = [variables]
      k_variables = len(variables)
  
      # If a string was given for `variable`, try to get it from exog names
      exog_names = self.model.exog_names
      for i in range(k_variables):
          variable = variables[i]
          if isinstance(variable, str):
              variables[i] = exog_names.index(variable)
  
      # Create the plot
      from scipy.stats import norm
      from statsmodels.graphics.utils import _import_mpl, create_mpl_fig
  
      plt = _import_mpl()
      fig = create_mpl_fig(fig, figsize)
  
      for i in range(k_variables):
          variable = variables[i]
          ax = fig.add_subplot(k_variables, 1, i + 1)
  
          # Get dates, if applicable
          if (
              hasattr(self.data, "dates")
              and self.data.dates is not None
          ):
              dates = self.data.dates._mpl_repr()
          else:
              dates = np.arange(self.nobs)
          d = max(self.nobs_diffuse, self.loglikelihood_burn)
  
          # Plot the coefficient
          coef = self.recursive_coefficients
          ax.plot(
              dates[d:],
              coef.filtered[variable, d:],
              label="Recursive estimates: %s" % exog_names[variable],
          )
  
          # Legend
          handles, labels = ax.get_legend_handles_labels()
  
          # Get the critical value for confidence intervals
          if alpha is not None:
              critical_value = norm.ppf(1 - alpha / 2.0)
  
              # Plot confidence intervals
              std_errors = np.sqrt(
                  coef.filtered_cov[variable, variable, :]
              )
              ci_lower = (
                  coef.filtered[variable] - critical_value * std_errors
              )
              ci_upper = (
                  coef.filtered[variable] + critical_value * std_errors
              )
              ci_poly = ax.fill_between(
                  dates[d:], ci_lower[d:], ci_upper[d:], alpha=0.2
              )
              ci_label = "$%.3g \\%%$ confidence interval" % (
                  (1 - alpha) * 100
              )
  
              # Only add CI to legend for the first plot
              if i == 0:
                  # Proxy artist for fill_between legend entry
                  # See https://matplotlib.org/1.3.1/users/legend_guide.html
                  p = plt.Rectangle(
                      (0, 0), 1, 1, fc=ci_poly.get_facecolor()[0]
                  )
  
                  handles.append(p)
                  labels.append(ci_label)
  
          ax.legend(handles, labels, loc=legend_loc)
  
          # Remove xticks for all but the last plot
          if i < k_variables - 1:
              ax.xaxis.set_ticklabels([])
  
      fig.tight_layout()
  
      return fig
  
imports: import numpy
  import pandas
  from statsmodels.compat.pandas import Appender
  from statsmodels.tools.data import _is_using_pandas
  from statsmodels.tsa.statespace.mlemodel import MLEModel, MLEResults, MLEResultsWrapper, PredictionResults, PredictionResultsWrapper
  from statsmodels.tsa.statespace.tools import concat
  from statsmodels.tools.tools import Bunch
  from statsmodels.tools.decorators import cache_readonly
  import statsmodels.base.wrapper
label_desc: Use image node_id 17 for calling the RecursiveLSResults obj's underlying member method code with example usage: obj.plot_recursive_coefficient(variables, alpha, legend_loc, fig, figsize) and returns: fig