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 CUSUM of squares statistic and significance bounds.
  
  Parameters
  ----------
  alpha : float, optional
      The plotted significance bounds are 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
  -----
  Evidence of parameter instability may be found if the CUSUM of squares
  statistic moves out of the significance bounds.
  
  Critical values used in creating the significance bounds are computed
  using the approximate formula of [1]_.
  
  References
  ----------
  .. [*] Brown, R. L., J. Durbin, and J. M. Evans. 1975.
     "Techniques for Testing the Constancy of
     Regression Relationships over Time."
     Journal of the Royal Statistical Society.
     Series B (Methodological) 37 (2): 149-92.
  .. [1] Edgerton, David, and Curt Wells. 1994.
     "Critical Values for the Cusumsq Statistic
     in Medium and Large Sized Samples."
     Oxford Bulletin of Economics and Statistics 56 (3): 355-65.
docstr_tok: ["Plot","the","CUSUM","of","squares","statistic","and","significance","bounds",".","Parameters","--","--","--","--","--","alpha",":","float",",","optional","The","plotted","significance","bounds","are","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","--","--","-","Evidence","of","parameter","instability","may","be","found","if","the","CUSUM","of","squares","statistic","moves","out","of","the","significance","bounds",".","Critical","values","used","in","creating","the","significance","bounds","are","computed","using","the","approximate","formula","of","[","1","]","_.","References","--","--","--","--","--","..","[","*","]","Brown",",","R.","L.",",","J.","Durbin",",","and","J.","M.","Evans",".","1975",".","``","Techniques","for","Testing","the","Constancy","of","Regression","Relationships","over","Time",".","''","Journal","of","the","Royal","Statistical","Society",".","Series","B","(","Methodological",")","37","(","2",")",":","149-92",".","..","[","1","]","Edgerton",",","David",",","and","Curt","Wells",".","1994",".","``","Critical","Values","for","the","Cusumsq","Statistic","in","Medium","and","Large","Sized","Samples",".","''","Oxford","Bulletin","of","Economics","and","Statistics","56","(","3",")",":","355-65","."]
code: def plot_cusum_squares(
      self, alpha=0.05, legend_loc="upper left", fig=None, figsize=None
  ):
      r"""
      Plot the CUSUM of squares statistic and significance bounds.
  
      Parameters
      ----------
      alpha : float, optional
          The plotted significance bounds are 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
      -----
      Evidence of parameter instability may be found if the CUSUM of squares
      statistic moves out of the significance bounds.
  
      Critical values used in creating the significance bounds are computed
      using the approximate formula of [1]_.
  
      References
      ----------
      .. [*] Brown, R. L., J. Durbin, and J. M. Evans. 1975.
         "Techniques for Testing the Constancy of
         Regression Relationships over Time."
         Journal of the Royal Statistical Society.
         Series B (Methodological) 37 (2): 149-92.
      .. [1] Edgerton, David, and Curt Wells. 1994.
         "Critical Values for the Cusumsq Statistic
         in Medium and Large Sized Samples."
         Oxford Bulletin of Economics and Statistics 56 (3): 355-65.
      """
      # Create the plot
      from statsmodels.graphics.utils import _import_mpl, create_mpl_fig
  
      _import_mpl()
      fig = create_mpl_fig(fig, figsize)
      ax = fig.add_subplot(1, 1, 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 cusum series and reference line
      ax.plot(dates[d:], self.cusum_squares, label="CUSUM of squares")
      ref_line = (np.arange(d, self.nobs) - d) / (self.nobs - d)
      ax.plot(dates[d:], ref_line, "k", alpha=0.3)
  
      # Plot significance bounds
      lower_line, upper_line = self._cusum_squares_significance_bounds(
          alpha
      )
      ax.plot(
          [dates[d], dates[-1]],
          upper_line,
          "k--",
          label="%d%% significance" % (alpha * 100),
      )
      ax.plot([dates[d], dates[-1]], lower_line, "k--")
  
      ax.legend(loc=legend_loc)
  
      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 21 for calling the RecursiveLSResults obj's underlying member method code with example usage: obj.plot_cusum_squares(alpha, legend_loc, fig, figsize) and returns: fig