I am assuming the variable out is the output parameter. However, I don't understand what is out[1+xi*xx>0]? Can someone explain this to me?
Thanks in advance, Chen dGEV <- function(x, xi, mu = 0, sigma = 1, logvalue=FALSE) { xx <- (x-mu)/sigma #use the new dGumbel which passes mu and sigma: #if (xi==0) out <- dGumbel(xx,logvalue=TRUE)-log(sigma) if (xi==0) { return(out <- dGumbel(x, mu, sigma, logvalue)); } else { out <- rep(-Inf,length(x)) out[1+xi*xx>0] <- (-1/xi-1)*log(1+xi*xx[1+xi*xx>0]) - (1+xi*xx[1+xi*xx>0])^(-1/xi) -log(sigma) } if (!(logvalue)) out <- exp(out) out } -- View this message in context: http://www.nabble.com/---for-R-tp25118139p25118139.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.