numdifftools
numdifftools copied to clipboard
vector-valued Hessian
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!
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: