Calculate the Variance Inflation Factor (VIF) of every ticker in the Toolkit instance, treated as regressors against one another.

Multicollinearity, where one regressor can (nearly) be predicted from the others, does not bias regression coefficients but inflates their standard errors. Individual coefficients can then look insignificant, and swing wildly between samples, even when the regressors jointly explain the dependent variable well. VIF measures this for each ticker by regressing it on all the other tickers.

The formula is as follows:

\[\text{VIF}_{i} = 1 / (1 - R ^{2_{i}})\] \[R ^{2_{i}} \text{is the R-squared of the OLS regression of ticker i's}\; \text{column} (\text{Return by default}) \text{on}\; a \;\text{constant and every other ticker's}\; \text{column}\]

Where R^2_i is the R-squared of regressing ticker i on all other tickers. A VIF of 1 means the ticker is uncorrelated with the others; a VIF of V means the variance of its coefficient is V times larger than it would be without multicollinearity. As a rule of thumb, a VIF above 10 (or above 5 for a stricter cutoff) signals problematic multicollinearity. This is common with assets that move closely together, such as several stocks from the same sector, and is worth checking before using them together as independent tickers in get_ols or the other regression methods.

Also known as: VIF.

Variance Inflation Factor (VIF) in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_vif as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["GOOGL", "META", "AMZN"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_vif()

Or, after setting up the Finance Toolkit MCP, ask:

How collinear were the daily returns of Alphabet, Meta and Amazon in 2025, measured by the variance inflation factor?

Which returns:

  VIF
GOOGL 1.4431
META 1.8234
AMZN 2.0804

Using Your Own Data

get_vif runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_vif()

Parameters

get_vif accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
columnstrThe historical data column to use. Defaults to “Return”."Return"
include_benchmarkboolWhether to include “Benchmark” among the regressors tested. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
Share