Henriksson-Merton Model
Calculate the Henriksson-Merton market timing model for each asset in the Toolkit instance.
Like the Treynor-Mazuy model (see get_treynor_mazuy_model), this separates market-timing skill from selectivity, but models timing as a piecewise (rather than quadratic) change in Beta: a “down-market” Beta and an “up-market” Beta.
The formula is as follows:
\[\text{Excess Return} = \text{Alpha} + \text{Beta} \cdot \text{Benchmark Excess Return} + \text{Up Market Beta} \cdot \max(\text{Benchmark Excess Return},\; 0) + \text{Residuals}\]Beta is the “down-market” Beta (the portfolio’s market exposure when the benchmark excess return is negative), and Beta + Up Market Beta is the “up-market” Beta. Up Market Beta > 0 indicates positive market-timing ability; Up Market Beta <= 0 indicates no timing ability.
Also known as: Henriksson-Merton piecewise timing model, HM model.
Henriksson-Merton Model in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_henriksson_merton_model as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["BRK-B", "FBCG"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.performance.get_henriksson_merton_model().xs("FBCG", level=0, axis=1)
Or, after setting up the Finance Toolkit MCP, ask:
What were the alpha, beta, up-market beta and R-squared of FBCG in the Henriksson-Merton market timing model in each year from 2021 to 2025?
Which returns:
| Alpha | Beta | Up Market Beta | R Squared | |
|---|---|---|---|---|
| 2021 | -0.0004 | 1.4217 | -0.064 | 0.7204 |
| 2022 | -0.0009 | 1.4208 | 0.0312 | 0.885 |
| 2023 | 0.0004 | 1.359 | 0.0602 | 0.8342 |
| 2024 | 0 | 1.4674 | 0.0496 | 0.8536 |
| 2025 | 0.0002 | 1.3907 | -0.0759 | 0.8893 |
Parameters
get_henriksson_merton_model accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”. | "quarterly" |
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 ratios. 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 |