[R] [] for R
kfcnhl
zhengchenji18 at hotmail.com
Mon Aug 24 17:33:36 CEST 2009
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.
More information about the R-help
mailing list