如何找到 R 中 GEV 分布中给定值的累积概率?

How to find cumulative probability for a given value in a GEV distribution in R?

我已将我的数据拟合到 GEV 分布中,我想知道如何找到 P(x<=40) 的概率。感谢您的帮助。

library(extRemes)
ams <- c(44.5,43.2,38.1,39.1,32.3,25.4,33.0,32.5,48.5,34.3,45.7,35.3,76.7,34.0,86.6,48.5,59.4,53.3,30.5,42.7,83.3,59.2,37.3,67.3,38.4,47.0,38.1,72.4,40.9,47.0,36.3,85.3,35.6,55.9,44.2,45.2,51.6,59.4,47.8,55.4,42.4,40.1,36.6,47.0,48.8,51.3,39.4,45.7)
fit_mle <- fevd(x=ams, method = "MLE", type="GEV",period.basis = "year")

根据 fevd 的帮助页面,第 Details 部分:

The GEV df is given by

PrX <= x = G(x) = exp[-(1 + shape*(x - location)/scale)^(-1/shape)]

因此您可以执行以下操作。

location <- fit_mle$results$par[1]
scale <- fit_mle$results$par[2]
shape <- fit_mle$results$par[3]
x <- 40
exp(-(1 + shape*(x - location)/scale)^(-1/shape))
#    shape 
#0.3381735

或者您可以简单地使用内置的累积分布函数。

pevd(x, location, scale, shape)
#[1] 0.3381735
library(EnvStats)
ams <- c(44.5,43.2,38.1,39.1,32.3,25.4,33.0,32.5,48.5,34.3,45.7,35.3,76.7,34.0,86.6,48.5,59.4,53.3,30.5,42.7,83.3,59.2,37.3,67.3,38.4,47.0,38.1,72.4,40.9,47.0,36.3,85.3,35.6,55.9,44.2,45.2,51.6,59.4,47.8,55.4,42.4,40.1,36.6,47.0,48.8,51.3,39.4,45.7)
fit_gev <- egevd(ams, method = "mle")# Parameters estimation
pgevd(40, location = fit_gev$parameters[[1]], scale = fit_gev$parameters[[2]],
  shape = fit_gev$parameters[[3]])

0.3381751