If the hessian is not negative definite or positive definite you have found
a saddle point. You may need to refine your methodology to find the
required minimum or maximum.
When you have found the proper extreme value you can calculate the the
Hessian using numerical derivatives. If calculating the Hessian and its
inverse in R it may be necessary to use high precision arithmetic.
John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
https://jcfrain.wordpress.com/
https://jcfraincv19.wordpress.com/
mailto:frainj@tcd.ie
mailto:frainj@gmail.com
On Tue, 24 Sept 2024 at 14:08, Sven Schreiber <sven.schreiber(a)fu-berlin.de>
wrote:
Am 23.09.2024 um 23:13 schrieb Alecos Papadopoulos:
> I was discussing with a colleague an empirical application, and he
> told me that the only problem he had was that some elements of the
> Hessian was "nan" because they came up with the wrong sign. But the R
> code that he used did print out the Hessian, with these elements as
> "nan".
>
> Can we do that in gretl (natively)? I ask because in standard
> mle-implementation with the option --hessian we may get "Hessian is
> not negative-definite, dropping back to OPG".
If you're in a middle of an algorithm that uses the Hessian as a
numerical input, I don't see how you can (or should) ignore that this
input is not what you think it is. Just like you wouldn't want to
standardize your data with a standard error estimate that somehow came
out as negative, or would you?
>
> What I ask is whether we can instruct gretl to stick with the Hessian,
> returning some "nan" values in the diagonal / std errors.
>
Not that I'm aware of. Regarding the cited "R code" of your colleague,
maybe it has a clever solution, maybe it just prints out interim stuff
and stops there, or maybe it does very unwise things; we have no way of
knowing.
cheers
sven
_______________________________________________
Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/