class_docstr: collection of descriptive statistical methods for time series
  
      
class_docstr_tok: ["collection","of","descriptive","statistical","methods","for","time","series"]
code: def plot4(self, fig=None, nobs=100, nacf=20, nfreq=100):
      data = self.data
      acf = self.acf(nacf)
      pacf = self.pacf(nacf)
      w = np.linspace(0, np.pi, nfreq, endpoint=False)
      spdr = self.periodogram()[:nfreq]  # (w)
  
      if fig is None:
          import matplotlib.pyplot as plt
  
          fig = plt.figure()
      ax = fig.add_subplot(2, 2, 1)
      namestr = " for %s" % self.name if self.name else ""
      ax.plot(data)
      ax.set_title("Time series" + namestr)
  
      ax = fig.add_subplot(2, 2, 2)
      ax.plot(acf)
      ax.set_title("Autocorrelation" + namestr)
  
      ax = fig.add_subplot(2, 2, 3)
      ax.plot(spdr)  # (wr, spdr)
      ax.set_title("Power Spectrum" + namestr)
  
      ax = fig.add_subplot(2, 2, 4)
      ax.plot(pacf)
      ax.set_title("Partial Autocorrelation" + namestr)
  
      return fig
  
file_path: statsmodels/statsmodels/tsa/descriptivestats.py
imports: import numpy
  from .None import stattools
label_desc: Use image node_id 8 for calling the TsaDescriptive obj's underlying member method code with example usage: obj.plot4(fig, nobs, nacf, nfreq) and returns: fig