[R] How does dsgh do the standardization?

Stat Tistician statisticiangermany at gmail.com
Thu May 2 11:11:21 CEST 2013

I try to understand how the generalized hyperbolic distribution is
standardized. One reference is the rugarch vignette, page 16-18:

I looked at the code of the dsgh function in the fBasics package:
> dsgh
function (x, zeta = 1, rho = 0, lambda = 1, log = FALSE)
    if (length(zeta) == 3) {
        lambda = zeta[3]
        rho = zeta[2]
        zeta = zeta[1]
    param = .paramGH(zeta, rho, lambda)
    ans = dgh(x, param[1], param[2], param[3], param[4], lambda,
<environment: namespace:fBasics>

As one can see, the code gets the values for lambda rho and zeta from
the parameters with which the function was called, e.g. I can call the
function via

> dsgh(x,zeta=2,rho=0.2,lambda=1,log=FALSE)

x is the grid, e.g. look at the curve with


The function now transforms this parameter (zeta=2, rho=0, lambda=1)
into another parametrization which is needed to use the dgh function
(alpha, beta, delta, mu). So after transforming the parameters, the
dgh function is used and the output of it is given. But the dgh
function is just the density of the generalized hyperbolic
distribution and not its standardized version. So at wich point is the
standardization done and how is this done?

Thanks a lot for your help!

More information about the R-help mailing list