Skip to main content

models.vif()

Variance inflation factors of a design’s columns, 1 / (1 - R2_j)

Usage

models.vif(design)

with R2_j that of column j on the others and an intercept (CAS Monograph 5, section 2.9). A constant column (the intercept) gets nan.

Parameters

design: Design

Returns

list of float
One per column, in the design’s order.

Raises

ValueError
If the non-constant columns are collinear.

Examples

>>> from prospicio.models import Design, vif
>>> d = Design([[1.0] * 4, [1.0, 2.0, 3.0, 4.0], [1.0, -1.0, -1.0, 1.0]],
...            ["(Intercept)", "x", "z"])
>>> [round(v, 12) for v in vif(d)[1:]]

[1.0, 1.0]