data(PORTw)
fit <- fevd(TMX1, PORTw, location.fun=~AOindex, units="deg C")
fit
tmp <- erlevd(fit, period=20)
if (FALSE) {
# Currently, the ci function does not work for effective
# return levels. There were coding issues encountered.
# But, could try:
#
z <- rextRemes(fit, n=500)
dim(z)
# 500 randomly drawn samples from the
# fitted model. Each row is a sample
# of data from the fitted model of the
# same length as the data. Each column
# is a separate sample.
sam <- numeric(0)
for( i in 1:500) {
cat(i, " ")
dat <- data.frame(z=z[,i], AOindex=PORTw$AOindex)
res <- fevd(z, dat, location.fun=~AOindex)
sam <- cbind(sam, c(erlevd(res)))
}
cat("\n")
dim(sam)
a <- 0.05
res <- apply(sam, 1, quantile, probs=c(a/2, 1 - a/2))
nm <- rownames(res)
res <- cbind(res[1,], tmp, res[2,])
colnames(res) <- c(nm[1], "Estimated 20-year eff. ret. level", nm[2])
res
}
Run the code above in your browser using DataLab