Commit b9c8fedb authored by Jana Ulrich's avatar Jana Ulrich
Browse files

correct sign in gev.lik function. It was returning the negative log likelihood before.

parent 666908b8
...@@ -340,9 +340,9 @@ gev.d.lik <- function(xdat,ds,mut,sigma0,xi,theta,eta,log=FALSE) { ...@@ -340,9 +340,9 @@ gev.d.lik <- function(xdat,ds,mut,sigma0,xi,theta,eta,log=FALSE) {
y <- 1 + xi * y y <- 1 + xi * y
if(log){ if(log){
return(sum(log(sigma.d) + y^(-1/xi) + log(y) * (1/xi + 1))) return(-sum(log(sigma.d) + y^(-1/xi) + log(y) * (1/xi + 1)))
}else{ }else{
return(prod(sigma.d * exp(y^(-1/xi)) * y ^ (1/xi + 1))) return(-prod(sigma.d * exp(y^(-1/xi)) * y ^ (1/xi + 1)))
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment