def test_plot_oth(self, close_figures):
      #just test that they run
      res = self.res
      plot_fit(res, 0, y_true=None)
      plot_partregress_grid(res, exog_idx=[0,1])
      plot_regress_exog(res, exog_idx=0)
      plot_ccpr(res, exog_idx=0)
      plot_ccpr_grid(res, exog_idx=[0])
      fig = plot_ccpr_grid(res, exog_idx=[0,1])
      for ax in fig.axes:
          add_lowess(ax)
 
      close_or_save(pdf, fig)
    def test_plot_oth(self, close_figures):
        #just test that they run
        res = self.res
        plot_fit(res, 0, y_true=None)
        plot_partregress_grid(res, exog_idx=[0, 1])
        plot_regress_exog(res, exog_idx=0)
        plot_ccpr(res, exog_idx=0)
        plot_ccpr_grid(res, exog_idx=[0])
        fig = plot_ccpr_grid(res, exog_idx=[0, 1])
        for ax in fig.axes:
            add_lowess(ax)

        close_or_save(pdf, fig)
    def test_plot_oth(self):
        #just test that they run
        res = self.res
        endog = res.model.endog
        exog = res.model.exog

        plot_fit(res, 0, y_true=None)
        plot_partregress_grid(res, exog_idx=[0, 1])
        plot_regress_exog(res, exog_idx=0)
        plot_ccpr(res, exog_idx=0)
        plot_ccpr_grid(res, exog_idx=[0])
        plot_ccpr_grid(res, exog_idx=[0, 1])

        plt.close('all')
    def test_plot_oth(self):
        #just test that they run
        res = self.res
        endog = res.model.endog
        exog = res.model.exog

        plot_fit(res, 0, y_true=None)
        plot_partregress_grid(res, exog_idx=[0,1])
        plot_regress_exog(res, exog_idx=0)
        plot_ccpr(res, exog_idx=0)
        plot_ccpr_grid(res, exog_idx=[0])
        plot_ccpr_grid(res, exog_idx=[0,1])

        plt.close('all')
    plt.plot(x1, x1beta, '-')
    ax.set_title('X_i beta_i plus residuals versus exog (CCPR)')  # + namestr)
    ax = fig6.add_subplot(2, 1, 2)
    plt.plot(x2, x2beta + res.resid, 'o')
    plt.plot(x2, x2beta, '-')

    #print res.summary()

doplots = 1
if doplots:
    fig1 = smrp.plot_fit(res, 0, y_true=None)
    smrp.plot_fit(res, 1, y_true=None)
    smrp.plot_partregress_grid(res, exog_idx=[0, 1])
    smrp.plot_regress_exog(res, exog_idx=0)
    smrp.plot_ccpr(res, exog_idx=0)
    smrp.plot_ccpr_grid(res, exog_idx=[0, 1])

tp = TestPlot()
tp.test_plot_fit()

fig1 = smrp.plot_partregress_grid(res, exog_idx=[0, 1])
#add lowess
ax = fig1.axes[0]
y0 = ax.get_lines()[0]._y
x0 = ax.get_lines()[0]._x
lres = sm.nonparametric.lowess(y0, x0, frac=0.2)
ax.plot(lres[:, 0], lres[:, 1], 'r', lw=1.5)
ax = fig1.axes[1]
y0 = ax.get_lines()[0]._y
x0 = ax.get_lines()[0]._x
lres = sm.nonparametric.lowess(y0, x0, frac=0.2)
Example #6
0
    ax.set_title('X_i beta_i plus residuals versus exog (CCPR)')# + namestr)
    ax = fig6.add_subplot(2,1,2)
    plt.plot(x2, x2beta + res.resid, 'o')
    plt.plot(x2, x2beta, '-')


    #print res.summary()

doplots = 1
if doplots:
    fig1 = smrp.plot_fit(res, 0, y_true=None)
    smrp.plot_fit(res, 1, y_true=None)
    smrp.plot_partregress_grid(res, exog_idx=[0,1])
    smrp.plot_regress_exog(res, exog_idx=0)
    smrp.plot_ccpr(res, exog_idx=0)
    smrp.plot_ccpr_grid(res, exog_idx=[0,1])

from statsmodels.graphics.tests.test_regressionplots import TestPlot
tp = TestPlot()
tp.test_plot_fit()

fig1 = smrp.plot_partregress_grid(res, exog_idx=[0,1])
#add lowess
ax = fig1.axes[0]
y0 = ax.get_lines()[0]._y
x0 = ax.get_lines()[0]._x
lres = sm.nonparametric.lowess(y0, x0, frac=0.2)
ax.plot(lres[:,0], lres[:,1], 'r', lw=1.5)
ax = fig1.axes[1]
y0 = ax.get_lines()[0]._y
x0 = ax.get_lines()[0]._x