Skip to main content
1 of 4
Richi W
  • 3.5k
  • 5
  • 37
  • 59

Calibrating Generalized Hyperbolic distribution in R- checking the parameters

I am using the R-package ghyp in order to calibrate and model. In fact my coding is based on this paper.

I know that I could do quite a robust fit using fit.ghypuv but I try to maximize a rather complicated likelihood function bases on a Markov chaine with ghyp marginals given the state. Therefore I use a non-linear optimizer (nloptr with parameter NLOPT_LN_NELDERMEAD and optim with parameter Nelder-Mead).

Part of the calibration is based on absolute centered moments of the ghyp distribution. These are calculated numerically using ghyp.moment.

The problem is that the optimizer searches the whole space and finds values such that I get the error message

Error in integrate(internal.moment, -Inf, Inf, tmp.order = order[i], 
lambda = object@lambda,  :  the integral is probably divergent

In the alpha-bar parametrization I assure that $\bar{\alpha}$ and $\sigma$ are great zero. Do I have to restrict the parameters further? If yes, then how can I do this? I use $\log$ and $\exp$ transformations to transform the non-negative parameters to the real line and some $(0,1)\rightarrow \mathbb{R}$ mapping for the probabilities of the chain.

E.g. I get the error in this parameter setting:

my.ghyp =ghyp(lambda = -1.570151, mu =  0.006935, sigma = 0.001719412, 
              gamma = -0.006574129, alpha.bar = 923391)
ghyp.moment(my.ghyp,order=1,absolute=TRUE,central=TRUE)

while it works, if I increase $\sigma$ slightly

my.ghyp =ghyp(lambda = -1.570151, mu =  0.006935, sigma = 0.003, 
              gamma = -0.006574129, alpha.bar = 923391)
ghyp.moment(my.ghyp,order=1,absolute=TRUE,central=TRUE)
Richi W
  • 3.5k
  • 5
  • 37
  • 59