Variance Inflation Factor (VIF)
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.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Variance Inflation Factor (VIF) for you. Just ask in plain English.
Calculate the Variance Inflation Factor (VIF) in Python
The Variance Inflation Factor (VIF) is available in the Econometrics module of the open-source Finance Toolkit. Install it 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
get_vif 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.
Related Diagnostics
The Econometrics module page introduces the module, and the sidebar lists all of its functions.