[R] Return Level in "ismev"
Peter Maclean
pmaclean2011 at yahoo.com
Sat Jul 9 21:11:48 CEST 2011
Is is possible to recover the return levels and intervals (as reported in a turn
level plot) at a given confidence interval? See a repducible example.
#Grouped vector
n <- data.frame(n = rep(c(1:3), each = 10))
y = rgamma(30, shape=0.5, rate = 1, scale = 10)
require(plyr)
require(ismev)
require(grDevices)
Gdata <- as.data.frame(cbind(n,y))
Gdata <- split(Gdata,Gdata$n)
rg <- lapply(Gdata, function(x){
m <- as.numeric(x$y)
gev.fit(m, ydat = NULL, mul = NULL, sigl = NULL, shl = NULL,
mulink = identity, siglink = identity, shlink = identity,
muinit = NULL, siginit = NULL, shinit = NULL,
show = TRUE, method = "SANN", maxit = 10000)
})
str(rg,no.list = TRUE)
rgd<- ldply(rg2, function(x) x$mle)
#Diag plot
pdf("H:/CLIMATE_PROJECT/REPOARESULTS/GRAPHS/diagplot.pdf")
par(mfrow=c(2,2))
rqf <- lapply(rg2, gev.diag)
dev.off()
More information about the R-help
mailing list