[英]Threshold for fitting generalized pareto model
Please I need the R code for setting a threshold while fitting a generalized pareto distribution.请我需要 R 代码来设置阈值,同时拟合广义帕累托分布。 I don't seem to be getting it right.我似乎没有做对。
I've just made a R package which exactly serves this purpose, namely gfiExtremes (soon on CRAN).我刚刚制作了一个 R package ,它正好用于这个目的,即gfiExtremes (很快在 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.它允许对广义帕累托分布 model 的分位数和帕累托超出分布的参数进行推断,无论是否假设超出阈值已知。
The data must be given as a numeric vector, say x
.数据必须以数字向量的形式给出,比如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.有关更多信息,请参阅 package 文档和小插图中的示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.