[R] How does dsgh do the standardization?
Stat Tistician
statisticiangermany at gmail.com
Thu May 2 11:11:21 CEST 2013
Hi,
I try to understand how the generalized hyperbolic distribution is
standardized. One reference is the rugarch vignette, page 16-18:
http://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf
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,
log)
ans
}
<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
curve(dsgh(x,zeta=2,rho=0.2,lambda=1,log=FALSE),xlim=c(-2,2))
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