Idiosyncratic Volatility
Calculate the Idiosyncratic Volatility, the volatility of the part of the returns the factors do not explain, per asset and period.
Ang, Hodrick, Xing and Zhang (2006) regress the daily excess returns of every stock on the Fama and French three factors within each month and take the standard deviation of the residuals. Stocks with a high idiosyncratic volatility earn strikingly low returns in the following month, the idiosyncratic volatility puzzle: a diversified investor is not exposed to this risk, so it should not be priced at all, let alone negatively. With model=”capm” the regression is the market model on the excess return of the benchmark instead.
For more information about the method, see the following paper:
- Ang, A., Hodrick, R. J., Xing, Y., & Zhang, X. (2006). “The Cross-Section of Volatility and Expected Returns.” The Journal of Finance, 61(1), 259-299.
The formula is as follows (with the default model=”fama_french”):
\[\text{Excess Return}_{t} = \alpha + \beta_{1} \cdot (\text{Mkt-RF}) \;\text{}_{t} + \beta_{2} \cdot \text{SMB}_{t} + \beta_{3} \cdot \text{HML}_{t} + \epsilon_{t}\] \[\text{Idiosyncratic Volatility} = \operatorname{Std}(\epsilon_{t}) \cdot \sqrt{\text{Trading Days per Period}}\]And with model=”capm”:
\[\text{Excess Return}_{t} = \alpha + \beta \cdot \text{Benchmark Excess Return}_{t} + \epsilon_{t}\]Where the regression runs on the daily returns within the period, Std is the sample standard deviation (ddof=1) of the residuals and the trading days per period are 252 / 12 (monthly), 252 / 4 (quarterly) or 252 (yearly), the scaling of the Volatility of the Risk module; with annualize=True it is √252 for every period. A period with fewer than 15 daily returns (the paper’s minimum) is NaN.
Also known as: IVOL, idiosyncratic risk, residual volatility, specific risk.
Idiosyncratic Volatility in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_idiosyncratic_volatility as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "TSLA", "KO"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2025-01-01",
end_date="2025-06-30",
)
toolkit.risk.get_idiosyncratic_volatility()
Or, after setting up the Finance Toolkit MCP, ask:
How volatile were Apple, Tesla and Coca-Cola apart from the market's moves in each month of the first half of 2025?
Which returns:
| Date | AAPL | TSLA | KO | Benchmark |
|---|---|---|---|---|
| 2025-01 | 0.077 | 0.1089 | 0.0393 | 0.0015 |
| 2025-02 | 0.0598 | 0.1275 | 0.0602 | 0.0028 |
| 2025-03 | 0.0576 | 0.168 | 0.0413 | 0.0037 |
| 2025-04 | 0.0545 | 0.1187 | 0.053 | 0.011 |
| 2025-05 | 0.0659 | 0.0962 | 0.0457 | 0.0035 |
| 2025-06 | 0.043 | 0.188 | 0.0286 | 0.0023 |
Parameters
get_idiosyncratic_volatility accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period each regression runs within (monthly, quarterly or yearly). Defaults to “monthly”, as in the paper. | "weekly" |
model | str | The factors to regress on: “fama_french” for the Fama and French three factors (Mkt-RF, SMB, HML) or “capm” for the excess return of the benchmark. Defaults to “fama_french”. | "fama_french" |
rolling | int | Regress on the daily returns of the last rolling periods instead of one period (e.g. period=’monthly’ and rolling=12 for a one-year window at every month end). Defaults to None. | 4 |
annualize | bool | Whether to scale the daily standard deviation of the residuals to a year (√252) instead of to the period. Defaults to False. | True |
region | str | The region whose Fama and French factors to use with model=”fama_french”: “United States”, “Developed”, “Developed ex US”, “Europe”, “Japan”, “Asia Pacific ex Japan” or “North America”. Every region’s factors are U.S. dollar returns. Defaults to “United States”. | "Europe" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the Idiosyncratic Volatility over time. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |