statsmodels.graphics.regressionplots.add_lowess#

statsmodels.graphics.regressionplots.add_lowess(ax, lines_idx=0, frac=0.2, *, exog=None, endog=None, **lowess_kwargs)[source]#

Add Lowess line to a plot

Parameters:
axAxesSubplot

The Axes to which to add the plot.

lines_idxint, optional

This is the line on the existing plot to which you want to add a smoothed lowess line.

fracfloat, optional

The fraction of the points to use when doing the lowess fit.

exogarray_like, optional

Data for the x-axis. If None, it will be extracted from the axis lines.

endogarray_like, optional

Data for the y-axis. If None, it will be extracted from the axis lines.

lowess_kwargs

Additional keyword arguments are passes to lowess.

Returns:
Figure

The figure that holds the instance.