statsmodels.stats.outliers_influence.variance_inflation_factor¶
-
statsmodels.stats.outliers_influence.variance_inflation_factor(exog, exog_idx, *, standardize=
True)[source]¶ Variance inflation factor, VIF, for one exogenous variable
The variance inflation factor is a measure for the increase of the variance of the parameter estimates if an additional variable, given by exog_idx is added to the linear regression. It is a measure for multicollinearity of the design matrix, exog.
One recommendation is that if VIF is greater than 5, then the explanatory variable given by exog_idx is highly collinear with the other explanatory variables, and the parameter estimates will have large standard errors because of this.
- Parameters:¶
- exog{
ndarray,DataFrame} design matrix with all explanatory variables, as for example used in regression
- exog_idx
int index of the exogenous variable in the columns of exog
- standardizebool,
optional If True, standardizes the design matrix columns to mean 0 and standard deviation 1 before computing VIF. This ensures numerical stability for non-linear transformations or micro-scale data. Default is True.
- exog{
- Returns:¶
floatvariance inflation factor
See also
xxxclass for regression diagnostics TODO: does not exist yet
Notes
This function does not save the auxiliary regression.
References