Hill Estimator
Calculate the Hill Estimator of the tail index of returns, per asset.
Unlike the (finite-sample) Skewness and Kurtosis above, the Hill Estimator is a semi-parametric estimate of how heavy the tail of the return distribution actually is, under the assumption that the tail follows a Pareto-type power law. Smaller values of the tail index indicate a heavier tail (more extreme outliers are likely) – as a rule of thumb, a tail index below 4 implies the Kurtosis is theoretically infinite, and below 2 implies the Variance itself is theoretically infinite.
For daily stock returns the tail index typically lies between about 2 and 5, while a normal distribution has an infinite tail index. The estimate depends on k: practitioners plot it against a range of k (a Hill plot) and read it where it is stable, since a small k is noisy and a large k pulls in the center of the distribution.
The formula is as follows (with the default tail=”left” and k=0.1):
\[\text{Hill Shape} (\xi) = (1 / k) \cdot \text{Σ} (\text{ln}\; X_{} (i) - \text{ln}\; X_{} (k + 1)) \text{for}\; i = 1,\;\; \text{...},\;\; \text{k}\] \[\text{Hill Tail Index} = 1 / \xi\] \[\text{Standard Error} = \text{Hill Tail Index} / \sqrt{k}\]Where X_(1) >= X_(2) >= … are the strictly positive losses (the negated returns, or the returns themselves for tail=”right”) sorted from large to small, and k is the number of order statistics used: int(0.1 * the number of positive losses) by default, or k itself when it is an integer.
For more information about the method, see the following paper:
- Hill, B.M. (1975). “A Simple General Approach to Inference About the Tail of a Distribution.” The Annals of Statistics, 3(5), 1163-1174.
Also known as: Hill tail index estimator, Hill’s estimator.
Hill Estimator in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_hill_estimator as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["BTCUSD", "^GSPC", "GCUSD"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_hill_estimator(k=60)
Or, after setting up the Finance Toolkit MCP, ask:
How heavy was the loss tail of the returns of Bitcoin, the S&P 500 and gold from 2021 to 2025, according to the Hill estimator on the 60 largest losses?
Which returns:
| BTCUSD | ^GSPC | GCUSD | Benchmark | |
|---|---|---|---|---|
| Hill Tail Index | 3.4392 | 2.9068 | 3.0565 | 2.7613 |
| Hill Shape (xi) | 0.2908 | 0.344 | 0.3272 | 0.3621 |
| Standard Error | 0.444 | 0.3753 | 0.3946 | 0.3565 |
| Observations Used (k) | 60 | 60 | 60 | 60 |
Parameters
get_hill_estimator accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
within_period | bool | Whether to calculate the estimator within the specified period or for the entire period. Defaults to False. Note that this requires intraday data when period = ‘daily’, since a single day only nests observations when intraday data was fetched. | True |
k | int | float | The number of upper order statistics to use. If a float in (0, 1) it is interpreted as the fraction of the strictly positive observations to use. A period without such observations reports NaN with 0 observations used. Defaults to 0.1 (the top 10%). | 0.05 |
tail | str | Which tail to estimate, one of “left” (the loss tail) or “right” (the gain tail). Defaults to “left”. | "right" |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |