Please I need the R code for setting a threshold while fitting a generalized pareto distribution. I don't seem to be getting it right.
Asked
Active
Viewed 72 times
0
-
What have you tried? Also see https://stackoverflow.com/help/how-to-ask and https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – mikeck Apr 27 '20 at 01:17
1 Answers
0
I've just made a R package which exactly serves this purpose, namely gfiExtremes (soon on CRAN).
remotes::install_github("stla/gfiExtremes", build_vignettes = TRUE)
It allows to perform inference on the quantiles for a generalized Pareto distribution model and on the parameters of the Pareto exceedance distribution, with or without assuming the exceedance threshold is known.
Usage
The data must be given as a numeric vector, say x.
library(gfiExtremes)
gf <- gfigpd2(x, beta = c(0.99, 0.995, 0.999))
summary(gf) # provides estimates and confidence intervals of the beta-quantiles
thresholdEstimate(gf) # an estimate of the threshold
See the examples in the package documentation and the vignette for more info.
Stéphane Laurent
- 59,551
- 14
- 99
- 196