Created
April 23, 2018 17:18
-
-
Save emredjan/4c2d5d93cbe3223489e18dab6f318709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fitted values (need a constant term for intercept) | |
model_fitted_y = model_fit.fittedvalues | |
# model residuals | |
model_residuals = model_fit.resid | |
# normalized residuals | |
model_norm_residuals = model_fit.get_influence().resid_studentized_internal | |
# absolute squared normalized residuals | |
model_norm_residuals_abs_sqrt = np.sqrt(np.abs(model_norm_residuals)) | |
# absolute residuals | |
model_abs_resid = np.abs(model_residuals) | |
# leverage, from statsmodels internals | |
model_leverage = model_fit.get_influence().hat_matrix_diag | |
# cook's distance, from statsmodels internals | |
model_cooks = model_fit.get_influence().cooks_distance[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment