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

Also known as: VIF.

For more information about the method, see specification_tests_model.get_vif.

Variance Inflation Factor (VIF) in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_vif as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "MSFT"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.econometrics.get_vif(period="weekly")

Which returns:

  VIF
AAPL 2.3688
MSFT 2.3688

Parameters

The function accepts the following parameters:

  • period (str, optional): The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”.
  • column (str, optional): The historical data column to use. Defaults to “Return”.
  • include_benchmark (bool, optional): Whether to include “Benchmark” among the regressors tested. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Share