提问人:Hydro 提问时间:6/20/2023 最后编辑:neilfwsHydro 更新时间:6/20/2023 访问量:91
用于洪水频率分析的极端 R 包?
extreme R package for Flood frequency analysis?
问:
下面是我的代码,我试图在其中估计各种回报期的频率。正如我估计的那样,我得到了错误.有什么想法如何解决这个问题?DF
data.frame
return_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("---------------")
}
答:
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))
检查它是否有效
评论
qgev
extRemes
qgev