用于洪水频率分析的极端 R 包?

extreme R package for Flood frequency analysis?

提问人:Hydro 提问时间:6/20/2023 最后编辑:neilfwsHydro 更新时间:6/20/2023 访问量:91

问:

下面是我的代码,我试图在其中估计各种回报期的频率。正如我估计的那样,我得到了错误.有什么想法如何解决这个问题?DFdata.framereturn_quantiles

library(extRemes)
library(tidyverse)

DF <- data.frame(Date = seq(as.Date("1980-01-01"), 
                            to = as.Date("2020-12-31"), 
                            by = "day"), 
                 A1 = runif(14976,1,500))

# Extract the annual maximum values
annual_max <- aggregate(A1 ~ year(Date), data = DF, FUN = max)
max_values <- annual_max$A1


gev_fit <- extRemes::fevd(max_values, type = "GEV")


return_period <- c(2, 5, 10, 20, 50, 100)  # Update with desired return periods
return_quantiles <- extRemes::qgev(return_period, gev_fit)

# Print the estimated return period and corresponding quantile
for (i in 1:length(return_period)) {
  print(paste("Return Period:", return_period[i], "years"))
  print(paste("Estimated Quantile:", return_quantiles[i]))
  print("---------------")
}
R 统计 Tidyverse 分位 数频率分析

评论

0赞 neilfws 6/20/2023
错误消息是什么?
0赞 Hydro 6/20/2023
错误:“qgev”不是从“namespace:extRemes”导出的对象
0赞 neilfws 6/20/2023
该错误意味着包中没有命名的函数,并且最新文档未列出该函数。也许它是在旧版本中,或者由不同的软件包提供?fExtremes 中有一个函数吗?qgevextRemesqgev

答:

0赞 Asif Iqbal Shah 6/20/2023 #1
# maximum-likelihood fitting of the GEV distribution
fit_mle <- fevd(discharge, method = "MLE", type="GEV")
# diagnostic plots
plot(fit_mle)
# return levels:
rl_mle <- return.level(fit_mle, conf = 0.05, return.period= c(2, 5, 10, 20, 50, 100))

检查它是否有效