I try to understand how the standardized generahl hyperbolic distribution is implemented in R. The command of the fBasics package is 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
}
The main point is the ans= dgh(x,....) this means, it uses the density of the general hyperbolic distribution with the given parameters. But the result is not the standardized version, but just the normal version, since it only transforms the specified parameters when the function is called to get another parameterized form but this is not the standardized version?
So you call the function with e.g.
> dsgh(mydata,zeta=2,rho=0.2,lambda=2,log=FALSE)
it transforms the zeta rho and lambda values into the parametrization, which is needed for the dgh function, but it does not standardize it?
And if you do
> dsgh(mydata,zeta=1,rho=0,lambda=1,log=FALSE)
this is not correct, since you only get one special case of the standardized version, but there are different possible parameter combinations in the transformed parametrization, which lead to a mean zero and variance equal to one (standardization)?
dghat theRcommand line you can see its full source code (which is only a half dozen lines after the argument checking is over), which ought to answer all your questions about it. – whuber May 01 '13 at 18:32.paramGHand.kappaGH), why don't you read them and resolve for yourself whatever issue you are concerned with? – whuber May 01 '13 at 18:36dsgh? It works! – whuber May 01 '13 at 18:44dsghet al. are not performing as claimed in their documentation. But I see this is really a duplicate of a previous question. – whuber May 01 '13 at 18:47