numdifftools icon indicating copy to clipboard operation
numdifftools copied to clipboard

vector-valued Hessian

Open naodell opened this issue 6 years ago • 1 comments

I use the Hessian tool to calculate the covariance matrix of a cost function (NLL). The NLL is calculated for multiple categories of data and then combined in a single number currently, but I would like to be able to factorize the Hessian of the NLL to account for the variance in each of the data categories. I know I could carry it out in each category independently, but I would then lose sensitivity to the parameter's correlations between the individual categories of data.

I would be willing to try to carry out the implementation myself if you could provide some guidance on how to get started.

Thanks!

naodell avatar May 06 '19 21:05 naodell

Isn't that what the Hessian wrapper class do already? The Hessian wrapper computes the Hessian matrix of the scalar function f with respect to a vector constructed from all variables (data categories) found in f:

\begin{align*}
(\Hessian f)_{ij} &\equiv \frac{\partial^{2} f}{\partial x_{i} \partial x_{j} }
\end{align*}

pbrod avatar Apr 28 '21 23:04 pbrod