[R] How to use gev.fit (package ismev) under box constraints?

NoSkill ButStyle NoSkillButStyle at web.de
Fri Oct 21 17:08:25 CEST 2011


Hallo,

it seems as if something did not work with my first email

I would like to estimate parameters of a general extreme value (GEV) distribution using maximum likelihood as implemented in the gev.fit function of package ismev. If I do the follwing:

y.training<- c(22, 22, 18, 19, 18, 18, 22, 27, 25, 19, 18, 21, 18, 20, 18, 19, 18, 21, 29, 18, 22, 19, 19, 24, 18, 21, 22, 20, 20, 27, 18, 20, 20, 18, 18, 18, 21, 18, 18, 21, 26, 19, 18, 19, 19, 18, 19, 18, 20, 20, 25, 21, 26, 22, 20, 19, 22, 21, 21, 20, 20, 19, 18, 22, 22, 27, 19, 20, 26, 29, 18, 20, 19, 22, 23, 18, 20, 20, 22, 18, 23, 18, 20, 19, 27, 21, 22, 18, 18, 19, 18, 21, 18, 23, 18, 18, 20, 20, 24, 19, 18, 19, 19, 23, 19, 18, 25, 18, 24, 19)
fit<-gev.fit(xdat=y.training,show=F)
round(fit$mle,2) # 18.00 , 0.00 , 3.96

# The estimated shape parameter is 3.96. I would like to perform the estimation under the constraint that the shape parameter is smaller than 1, but the following does not work:

fit<-gev.fit(xdat=y.training,show=F,method="L-BFGS-B",lower=c(0,0,-2),upper=c(50,10,1))
round(fit$mle,2) # 18.09 , 0.27 , 3.05

It seems as is the "lower" and "upper" values are not passed to the optim function in the way they should be. A warning says that they are only passed to the "control" part of optim. Therefore my question: (How) is it possible to use the gev.fit-function to perform the ML estimation under the constraint that the shape parameter is smaller than 1? Or more general: Is it possible to use the gev.fit function under box constraints as it should be possible for optim?

Thanks in advance.



More information about the R-help mailing list