Using Numdifftools with ExternalEvaluate to calculate the Hessian

I need to compute numerically the Hessian of a numerical (scalar) function. Mathematica does not have a numerical Hessian routine (funny thing..) and so I am using this implementation. However, though simple and fast, it is not very robust and I would like to use Numdifftools. How can I compute the Hessian using the Python nd.Hessian routine? My function takes a vector of arbitrary length as argument and cannot take complex numbers.

• This post may be of interest... – ilian May 18 '18 at 18:26
• @ilian Thanks! With ExperimentalNumericalFunction I can indeed compute the Hessian numerically. It seems to work fine. However, it is undocumented and I do not know if it is as robust as Numdifftools. In the latter [...] Finite differences are used in an adaptive manner, coupled with a Richardson extrapolation methodology to provide a maximally accurate result. [...] – Valerio May 19 '18 at 13:02
• I created a new question regarding the use of ExperimentalNumericalFunction to compute the Hessian. – Valerio May 19 '18 at 15:45