Factor Asset Correlations
Calculates factor exposures for each asset.
The major difference between the Fama and French Model here is that the correlation is taken as opposed to a Linear Regression in which the R-squared or Slope can be used to understand the exposure to each factor.
For assessing the exposure or influence of a stock to external factors, it’s often preferable to use R-squared (R²) or Beta because it explicitly measures how well the factors explain the stock’s returns. A higher R² indicates that the stock’s returns are more closely related to the factors, and thus, the factors have a greater influence on the stock’s performance.
However, since the results are closely related and tend to point into the same direction it could be fine to use correlations as well depending on the level of accuracy required.
Also known as: factor exposure, asset correlations.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Factor Asset Correlations for you. Just ask in plain English.
Calculate the Factor Asset Correlations in Python
The Factor Asset Correlations is available in the Performance module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_factor_asset_correlations as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(["AAPL", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")
toolkit.performance.get_factor_asset_correlations()["AAPL"]
Which returns:
| Mkt-RF | SMB | HML | RMW | CMA | |
|---|---|---|---|---|---|
| 2021 | 0.6626 | -0.0091 | -0.3248 | -0.0655 | -0.0029 |
| 2022 | 0.8796 | 0.0561 | -0.5479 | -0.2577 | -0.4763 |
| 2023 | 0.6988 | -0.0083 | -0.2833 | -0.1014 | -0.463 |
| 2024 | 0.5184 | 0.0358 | -0.3171 | -0.0563 | -0.0977 |
| 2025 | 0.7408 | 0.0646 | -0.2085 | -0.1108 | 0.0761 |
| 2026 | 0.4609 | 0.0502 | -0.1759 | -0.0847 | -0.0546 |
Parameters
get_factor_asset_correlations accepts the following parameters:
- period (str, optional): The period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”.
- factors_to_calculate (list of str, optional): List of factors to calculate scores and residuals for. Defaults to [“Mkt-RF”, “SMB”, “HML”, “RMW”, “CMA”].
- rounding (int, optional): The number of decimals to round the results to. Defaults to 4.
- show_columns (list of str, optional): Restrict the result to these top level columns. Defaults to None, which returns every column.
Related Performance Metrics
The Performance module page introduces the module, and the sidebar lists all of its functions.