statsmodels.stats.outliers_influence.MLEInfluence¶
-
class
statsmodels.stats.outliers_influence.
MLEInfluence
(results, resid=None, endog=None, exog=None, hat_matrix_diag=None, cov_params=None, scale=None)[source]¶ Local Influence and outlier measures (experimental)
This currently subclasses GLMInfluence instead of the other way. No common superclass yet. This is another version before checking what is common
- Parameters
- resultsinstance of results class
This only works for model and results classes that have the necessary helper methods.
- other arguments are only to override default behavior and are used instead
- of the corresponding attribute of the results class.
- By default resid_pearson is used as resid.
Notes
MLEInfluence produces the same results as GLMInfluence (verified for GLM Binomial and Gaussian). There will be some differences for non-canonical links or if a robust cov_type is used.
Warning: This does currently not work for constrained or penalized models, e.g. models estimated with fit_constrained or fit_regularized.
This has not yet been tested for correctness when offset or exposure are used, although they should be supported by the code.
status: experimental, This class will need changes to support different kinds of models, e.g. extra parameters in discrete.NegativeBinomial or two-part models like ZeroInflatedPoisson.
- Attributes
- hat_matrix_diag (hii)This is the generalized leverage computed as the
local derivative of fittedvalues (predicted mean) with respect to the observed response for each observation.
d_params
Change in parameters computed with one Newton step using theChange in parameter estimates
- dbetaschange in parameters divided by the standard error of parameters
from the full model results,
bse
.cooks_distance
quadratic form for change in parameters weighted byCook’s distance and p-values
resid_studentized
In the general MLE case resid_studentized areScore residual divided by sqrt of hessian factor
d_fittedvalues
local change of expected mean given the change in theChange in expected response, fittedvalues
d_fittedvalues_scaled
same as d_fittedvalues but scaled by the standardChange in fittedvalues scaled by standard errors
params_one
is the one step parameter estimate computed asparams
Parameter estimate based on one-step approximation
Methods
Cook’s distance and p-values
Change in expected response, fittedvalues
d_params
()Change in parameter estimates
dfbetas
()Scaled change in parameter estimates
Diagonal of the generalized leverage
Parameter estimate based on one-step approximation
plot_index
([y_var, threshold, title, ax, idx])index plot for influence attributes
plot_influence
([external, alpha, criterion, …])Plot of influence in regression.
Score residual divided by sqrt of hessian factor
Creates a DataFrame with influence results.