Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gpdfit

Estimate parameters of the Generalized Pareto distribution


Description

Given a sample x, Estimate the parameters k and σ of the generalized Pareto distribution (GPD), assuming the location parameter is 0. By default the fit uses a prior for k, which will stabilize estimates for very small sample sizes (and low effective sample sizes in the case of MCMC samples). The weakly informative prior is a Gaussian prior centered at 0.5.

Usage

gpdfit(x, wip = TRUE, min_grid_pts = 30, sort_x = TRUE)

Arguments

x

A numeric vector. The sample from which to estimate the parameters.

wip

Logical indicating whether to adjust k based on a weakly informative Gaussian prior centered on 0.5. Defaults to TRUE.

min_grid_pts

The minimum number of grid points used in the fitting algorithm. The actual number used is min_grid_pts + floor(sqrt(length(x))).

sort_x

If TRUE (the default), the first step in the fitting algorithm is to sort the elements of x. If x is already sorted in ascending order then sort_x can be set to FALSE to skip the initial sorting step.

Details

Here the parameter k is the negative of k in Zhang & Stephens (2009).

Value

A named list with components k and sigma.

References

Zhang, J., and Stephens, M. A. (2009). A new and efficient estimation method for the generalized Pareto distribution. Technometrics 51, 316-325.

See Also


loo

Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models

v2.4.1
GPL (>= 3)
Authors
Aki Vehtari [aut], Jonah Gabry [cre, aut], Mans Magnusson [aut], Yuling Yao [aut], Paul-Christian Bürkner [aut], Topi Paananen [aut], Andrew Gelman [aut], Ben Goodrich [ctb], Juho Piironen [ctb], Bruno Nicenboim [ctb]
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.