statsmodels.graphics.regressionplots.ceres_resids#
- statsmodels.graphics.regressionplots.ceres_resids(results, focus_exog, frac=0.66, cond_means=None)[source]#
Calculate the CERES residuals (Conditional Expectation Partial Residuals) for a fitted model
- Parameters:
- results
modelresultsinstance The fitted model for which the CERES residuals are calculated.
- focus_exog
intorstr The column index of results.model.exog, or the variable name, used as the ‘focus variable’.
- frac
float,optional Lowess smoothing parameter for estimating the conditional means. Not used if cond_means is provided.
- cond_meansarray_like,
optional If provided, the columns of this array are the conditional means E[exog | focus exog], where exog ranges over some or all of the columns of exog other than focus exog. If this is an empty nx0 array, the conditional means are treated as being zero. If None, the conditional means are estimated.
- results
- Returns:
ndarrayThe CERES residuals.
Notes
If cond_means is not provided, it is obtained by smoothing each column of exog (except the focus column) against the focus column.
Currently only supports GLM, GEE, and OLS models.