Skip to contents

Maximum likelihood fit of the generalized Pareto distribution P(X > x) = (1 + xi * x / beta)^(-1 / xi) to exceedances (values over a threshold, minus the threshold), as evd::fpot or SciPy's genpareto.fit(floc = 0).

Usage

gpd_fit(exceedances)

Arguments

exceedances

At least 3 non-negative values, not all equal.

Value

A named numeric vector c(xi = , beta = ).

Examples

y <- 2 * expm1(0.5 * -log1p(-ppoints(1000))) / 0.5 # GPD(0.5, 2) quantiles
gpd_fit(y)
#>        xi      beta 
#> 0.4984701 2.0020203