Learn R Programming

heavytails (version 0.1.1)

hill_estimator: Hill Estimator

Description

Hill estimator used to calculate the tail index (alpha) of input data.

Usage

hill_estimator(data, k, na.rm = FALSE)

Value

A single numeric scalar: Hill estimator calculation of the tail index \(\alpha\).

Arguments

data

A numeric vector of i.i.d. observations.

k

An integer specifying the number of top order statistics to use (the size of the tail). Must be strictly less than the sample size.

na.rm

Logical. If TRUE, missing values (NA) are removed before analysis. Defaults to FALSE.

Details

$$\hat \alpha_H = \frac{1}{\frac{1}{k} \sum_{i=1}^{k} log(\frac{X_{(i)}}{X_{(k)}})}$$

where \(X_{(1)} \ge X_{(2)} \ge \dots \ge X_{(n)}\) are the order statistics of the data (descending order).

References

Hill, B. M. (1975). A Simple General Approach to Inference About the Tail of a Distribution. The Annals of Statistics, 3(5), 1163–1174. http://www.jstor.org/stable/2958370

Nair, J., Wierman, A., & Zwart, B. (2022). The Fundamentals of Heavy Tails: Properties, Emergence, and Estimation. Cambridge University Press. (pp. 203-205) tools:::Rd_expr_doi("10.1017/9781009053730")

Examples

Run this code

xmin <- 1
alpha <- 2
r <- runif(800, 0, 1)
x <- (xmin * r^(-1/(alpha)))
hill <- hill_estimator(data = x, k = 5)


Run the code above in your browser using DataLab