[R] Saving fExtremes estimates and k-block return level with confidence intervals.

Peter Maclean pmaclean2011 at yahoo.com
Thu Jun 30 06:16:15 CEST 2011


I am estimating a large model by groups. How do you save the results and returns 
the associated quantiles?
For this example I need a data frame 
n    xi        mu        beta 
1   0.1033614  2.5389580 0.9092611
2   0.3401922  0.5192882 1.5290615 
3   0.5130798  0.5668308 1.2105666
I also want to apply gevrlevelPlot() for each "n" or group.
 
#Example
n <- c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,3)
y <- c(2,3,2,3,4,5,6,1,0,0,0,6, 2, 1, 0, 0,9,3)
z <- as.data.frame(cbind(n,y))
colnames(z) <- c("n","y")
library(fExtremes)
z <- split(z, z$n)
res2 <-lapply(z, function(x){
               m <- as.numeric(x$y)
               gevFit(m, block = 1, type = c("pwm"))
                })
> res2
$`1`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.1033614 2.5389580 0.9092611 
Description
  Wed Jun 29 23:07:48 2011 

$`2`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.3401922 0.5192882 1.5290615 
Description
  Wed Jun 29 23:07:48 2011 

$`3`
Title:
 GEV Parameter Estimation 
Call:
 gevFit(x = m, block = 1, type = c("pwm"))
Estimation Type:
  gev pwm 
Estimated Parameters:
       xi        mu      beta 
0.5130798 0.5668308 1.2105666 
Description
  Wed Jun 29 23:07:48 2011 




More information about the R-help mailing list