adcomp icon indicating copy to clipboard operation
adcomp copied to clipboard

Hessian matrix

Open cadigann opened this issue 11 years ago • 3 comments
trafficstars

Hello All

I am a new user with little experience with cpp so be nice to me.

obj$fn and obj$gr in TMB examples return the function value to minimize, and its gradient. obj$he() is there too, and it seems to return the hessian. When I run obj$he(par) I get the error message:

Error in .Call("tmb_invQ_tril_halfdiag", L, PACKAGE = "TMB") : 'L' is missing

None of the examples use the hessian in nlminb so I am thinking this error is expected and TMB is not returning the hessian function,

Am I correct?

thks noel cadigan

cadigann avatar Jun 09 '14 18:06 cadigann

Hi Noel,

The analytical Hessian obj$he currently only works for models without random effects. As you correctly point out, you don't need obj$he in order to use nlminb or sdreport.

Kasper

kaskr avatar Jun 10 '14 14:06 kaskr

Thanks Kasper

For curiosity, I ran TMB+nlminb for a problem with no random effects but about 700 parameters and 12000 observations. without using hessian. runtime 3.41 sec, outer mgc: 0.08780289 using hessian: runtime 51.20 sec, outer mgc: 0.001555197

Using the hessian gives a better result in terms of mgc but much slower. I need to figure out how to get nlminb from stopping interations too soon

cadigann avatar Jun 11 '14 08:06 cadigann

sorry I closed by mistake

cadigann avatar Jun 11 '14 09:06 cadigann