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 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

get_hill_estimator is part of the Risk module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_hill_estimator as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AMZN", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.risk.get_hill_estimator(period="weekly", within_period=False)

Which returns:

  AAPL MSFT Benchmark
Hill Tail Index 2.6934 5.0478 2.1843
Hill Shape (xi) 0.3713 0.1981 0.4578
Standard Error 1.018 1.9079 0.8256
Observations Used (k) 7 7 7

Parameters

get_hill_estimator accepts the following parameters:

  • period (str, optional): The data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “quarterly” if the Toolkit is initialized with quarterly=True, otherwise “yearly”.
  • within_period (bool, optional): Whether to calculate the estimator within the specified period or for the entire period. Defaults to True.
  • k (int | float, optional): 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. Defaults to 0.1 (the top 10%).
  • tail (str, optional): Which tail to estimate, one of “left” (the loss tail) or “right” (the gain tail). Defaults to “left”.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Share