statsmodels.gam.generalized_additive_model.GLMGamResults.plot_partial

GLMGamResults.plot_partial(smooth_index, plot_se=True, cpr=False, include_constant=True, ax=None)[source]

plot the contribution of a smooth term to the linear prediction

Parameters:
  • smooth_index (int) – index of the smooth term within list of smooth terms

  • plot_se (bool) – If plot_se is true, then the confidence interval for the linear prediction will be added to the plot.

  • cpr (bool) – If cpr (component plus residual) is true, then a scatter plot of the partial working residuals will be added to the plot.

  • include_constant (bool) – If true, then the estimated intercept is added to the prediction and its standard errors. This avoids that the confidence interval has zero width at the imposed identification constraint, e.g. either at a reference point or at the mean.

  • ax (None or matplotlib axis instance) – If ax is not None, then the plot will be added to it.

Returns:

If ax is None, the created figure. Otherwise, the Figure to which ax is connected.

Return type:

Figure