# NOT RUN {
# We need the evd package
got_evd <- requireNamespace("evd", quietly = TRUE)
if (got_evd) {
library(evd)
# An example from the evd::fgev documentation
set.seed(3082019)
uvdata <- evd::rgev(100, loc = 0.13, scale = 1.1, shape = 0.2)
M1 <- evd::fgev(uvdata, nsloc = (-49:50)/100)
adj_fgev <- alogLik(M1)
summary(adj_fgev)
# An example from Chandler and Bate (2007)
owfit <- fgev(ow$temp, nsloc = ow$loc)
adj_owfit <- alogLik(owfit, cluster = ow$year)
summary(adj_owfit)
# An example from the evd::fpot documentation
set.seed(3082019)
uvdata <- evd::rgpd(100, loc = 0, scale = 1.1, shape = 0.2)
M1 <- fpot(uvdata, 1)
adj_fpot <- alogLik(M1)
summary(adj_fpot)
# Fit using the pp model, rather than the gpd
M1 <- fpot(uvdata, 1, model = "pp", npp = 365)
adj_fpot <- alogLik(M1)
summary(adj_fpot)
}
# }
Run the code above in your browser using DataLab