# NOT RUN {
got_evd <- requireNamespace("evd", quietly = TRUE)
if (got_evd) {
library(evd)
small <- fgev(ow$temp, nsloc = ow[, "loc"])
adj_small <- alogLik(small, cluster = ow$year)
tiny <- fgev(ow$temp)
adj_tiny <- alogLik(tiny, cluster = ow$year)
anova(adj_small, adj_tiny)
set.seed(4082019)
uvdata <- evd::rgev(100, loc = 0.13, scale = 1.1, shape = 0.2)
M0 <- fgev(uvdata)
M1 <- fgev(uvdata, nsloc = (-49:50)/100)
adj0 <- alogLik(M0)
adj1 <- alogLik(M1)
anova(adj1, adj0)
}
got_texmex <- requireNamespace("texmex", quietly = TRUE)
if (got_texmex) {
library(texmex)
large <- evm(temp, ow, gev, mu = ~ loc, phi = ~ loc, xi = ~loc)
medium <- evm(temp, ow, gev, mu = ~ loc, phi = ~ loc)
small <- evm(temp, ow, gev, mu = ~ loc)
tiny <- evm(temp, ow, gev)
adj_large<- alogLik(large, cluster = ow$year)
adj_medium <- alogLik(medium, cluster = ow$year)
adj_small <- alogLik(small, cluster = ow$year)
adj_tiny <- alogLik(tiny, cluster = ow$year)
anova(adj_large, adj_medium, adj_small, adj_tiny)
}
# }
Run the code above in your browser using DataLab