Hi,
I want to fit a standardized generalized hyperbolic distribution to my
data, I am using the dsgh command of the fBasics package and the optim
command.

I tried the following:

----------------------------------------------------------------------------------------------------------------------------
startvalue<-c(1,0.5,1)
loglikstandghyp <-function(zetapar,rhopar,lambdapar){
if(par>0) 
return(-sum(log(dsgh(mydata,zeta=zetapar,rho=rhopar,lambda=lambdapar))))
else return(Inf)
}

optim(startvalue, fn=loglikstandghyp, method="BFGS")
-----------------------------------------------------------------------------------------------------------------------------

the problem is, that I get the following error message (in german):

Fehler in if (delta <= 0) stop("delta must be greater than zero") :
  Fehlender Wert, wo TRUE/FALSE nötig ist

Now my question is, where is my mistake?

Thanks a lot for your help!


--
Neumann, Conrad

______________________________________________
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.

Reply via email to