[R] Fit a standardized generalized hyperbolic distribution to my data?

Neuman Co neumancohu at gmail.com
Thu May 9 10:27:00 CEST 2013


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



More information about the R-help mailing list