@@ -132,3 +132,50 @@ function linearpredictor end
132132In-place version of [`linearpredictor`](@ref), storing the result in `storage`.
133133"""
134134function linearpredictor! end
135+
136+ """
137+ vif(m::RegressionModel)
138+
139+ Compute the variance inflation factor (VIF).
140+
141+ The [VIF](https://en.wikipedia.org/wiki/Variance_inflation_factor) measures
142+ the increase in the variance of a parameter's estimate in a model with multiple parameters relative to
143+ the variance of a parameter's estimate in a model containing only that parameter.
144+
145+ See also [`gvif`](@ref).
146+
147+ !!! warning
148+ This method will fail if there is (numerically) perfect multicollinearity,
149+ i.e. rank deficiency. In that case though, the VIF
150+ is not particularly informative anyway.
151+ """
152+ function vif end
153+ # This generic function is owned by StatsModels.jl, which is the sole provider
154+ # of the default definition.
155+
156+ """
157+ gvif(m::RegressionModel; scale=false)
158+
159+ Compute the generalized variance inflation factor (GVIF).
160+
161+ If `scale=true`, then each GVIF is scaled by the degrees of freedom
162+ for (number of coefficients associated with) the predictor: ``GVIF^(1 / (2*df))``.
163+
164+ The [GVIF](https://doi.org/10.2307/2290467)
165+ measures the increase in the variance of a (group of) parameter's estimate in a model
166+ with multiple parameters relative to the variance of a parameter's estimate in a
167+ model containing only that parameter. For continuous, numerical predictors, the GVIF
168+ is the same as the VIF, but for categorical predictors, the GVIF provides a single
169+ number for the entire group of contrast-coded coefficients associated with a categorical
170+ predictor.
171+
172+ See also [`vif`](@ref).
173+
174+ ## References
175+
176+ Fox, J., & Monette, G. (1992). Generalized Collinearity Diagnostics.
177+ Journal of the American Statistical Association, 87(417), 178. doi:10.2307/2290467
178+ """
179+ function gvif end
180+ # This generic function is owned by StatsModels.jl, which is the sole provider
181+ # of the default definition.
0 commit comments