警告消息:在 log(z) 中:在 R 中计算 fevd GEV 时产生的 NaN

Warning message: In log(z) : NaNs produced when computing fevd GEV in R

我正在尝试计算最低温度的 return 值,该值是负值,我收到一条警告消息:

In log(z): NaNs produced

这很奇怪,因为我只收到某些矢量(95 个中的 21 个)的警告消息。我试图重新启动 R,但不知道还能做什么。使用 is.nan?但我不知道在哪里合并它...

我的数据是:

mmm <- c(-18.78, -16.81, -15.92, -14.03, -12.58, -25.26 ,-22.57, -27.86, -15.39, -13.32,  -8.37, -15.10, -14.33, -14.50, -21.93, -17.75, -24.64, -24.96, -17.91, -17.68, -15.43, -18.16, -19.35, -27.34, -18.60, -14.34, -24.10, -13.75, -12.18, -17.02, -21.08, -21.14, -23.85, -17.80, -18.22, -11.15, -16.44, -15.20, -17.51, -12.33, -4.10)

代码:

library(extRemes)
library(xts)
mle <- fevd(mmm, method = "MLE", type = "GEV")
rl <- return.level(mle, conf=0.05, return.period=c(10, 20, 50, 100))

rl 

结果是:

fevd(x = mmm, type = "GEV", method = "MLE")
get(paste("return.level.fevd.", newcl, sep = ""))(x = x, 
    return.period = return.period, conf = 0.05)

 GEV model fitted to  mmm  
Data are assumed to be  stationary 
[1] "Return Levels for period units in years"
 10-year level  20-year level  50-year level 
  1.998987e+67   3.880116e+88  1.393228e+116 
100-year level 
 6.205119e+136

我找到了我的问题的答案,也许它会对某人有所帮助。使用负值(例如 C 中的 Tmin),GEV 分析中的正常过程是通过乘以 * (-1) 来转换它们,以便分析正记录。此外,您可以将它们转换为开尔文。一旦拟合了 GEV,您就可以轻松地对结果进行反变换。