# NOT RUN {
got_evd <- requireNamespace("evd", quietly = TRUE)
if (got_evd) {
library(evd)
# An example from the evd::fgev documentation
set.seed(4082019)
uvdata <- evd::rgev(100, loc = 0.13, scale = 1.1, shape = 0.2)
M1 <- fgev(uvdata)
adj_fgev <- alogLik(M1)
# Large inc set here for speed, sacrificing accuracy
rl <- return_level(adj_fgev, inc = 0.5)
summary(rl)
plot(rl)
}
got_ismev <- requireNamespace("ismev", quietly = TRUE)
if (got_ismev) {
library(ismev)
# An example from the ismev::gev.fit documentation
gev_fit <- gev.fit(revdbayes::portpirie, show = FALSE)
adj_gev_fit <- alogLik(gev_fit)
# Large inc set here for speed, sacrificing accuracy
rl <- return_level(adj_gev_fit, inc = 0.05)
summary(rl)
plot(rl)
}
# }
Run the code above in your browser using DataLab