Solved – Variance-covariance matrix of the parameter estimates wrongly calculated

I fitted an hyperbolic distribution to my data with the hyperbFit(mydata,hessian=TRUE) command (package HyperbolicDist). The hessian looks like:

> hyperbfitmymodel$hessian             hyperbPi      lZeta     lDelta            mu hyperbPi   536.61654  -23.82800   25.62345   26153.16561 lZeta      -23.82800  250.74196 -261.20570     -35.58481 lDelta      25.62345 -261.20570  272.77771     182.75927 mu       26153.16561  -35.58481  182.75927 2028904.75586 

Now I want to calculate the variance-covariance matrix of the parameter estimates, according to this page 2:

The asymptotic covariance matrix of $hat{theta}$ is given by the
inverse of the negative of the Hessian matrix evaluated at
$hat{theta}$.

I therefore calculate:

solve(-hyperbfitalv$hessian) 

which gives

         hyperbPi         lZeta        lDelta            mu hyperbPi -5.113433e-03 -0.0091511819 -0.0083271877  6.650321e-05 lZeta    -9.151182e-03 -1.6617499980 -1.5905496996  2.320893e-04 lDelta   -8.327188e-03 -1.5905496996 -1.5261031428  2.169113e-04 mu        6.650321e-05  0.0002320893  0.0002169113 -1.365591e-06 

This looks clearly wrong to me, because there are negative values for the variance, but a variance cannot be negative? The covariance yes, but not the variance?

EDIT: The complete output of hyperbFit(mydata,hessian=TRUE):

Data:     mydata Parameter estimates:        pi       zeta      delta         mu    0.090747   0.204827   0.002035  -0.002494   Likelihood:         756.911  Method:             Nelder-Mead  Convergence code:   0  Iterations:         365  

2nd EDIT: If I use solve(hyperbfitalv$hessian) I get

             hyperbPi         lZeta        lDelta            mu hyperbPi  5.113433e-03  0.0091511819  0.0083271877 -6.650321e-05 lZeta     9.151182e-03  1.6617499980  1.5905496996 -2.320893e-04 lDelta    8.327188e-03  1.5905496996  1.5261031428 -2.169113e-04 mu       -6.650321e-05 -0.0002320893 -0.0002169113  1.365591e-06 

3rd EDIT: The output of summary(hyperbfitalv):

Data:      mydata Parameter estimates:        pi          zeta         delta         mu         0.090747     0.204827     0.002035    -0.002494    ( 0.071508)  ( 0.264040)  ( 0.002514)  ( 0.001169) Likelihood:         756.911  Method:             Nelder-Mead  Convergence code:   0  Iterations:         365  

4th EDIT: Ok, this is the hessian of pi, log(zeta), log(delta), and mu but how can I get the hessian of pi, zeta, delta and mu?

Optim in default setting is doing minimization, see the manual:

By default optim performs minimization

So the output is already the negative hessian.

It should be further noted that:

Because the parameters in the call to the optimiser are pi, log(zeta), log(delta), and mu, the delta method is used to obtain the standard errors for zeta and delta.

Source here.

Similar Posts:

Rate this post

Leave a Comment