I am minimizing a negative log-likelihood function and I am using Minuit2Minimizer with the migrad algorithm and strategy = 2. Unfortunately, the hessian matrix is forced to be positive definite by adding a positive number to the diagonal elements. I have a suspicion that the intrinsic problem are large correlations between some nuisance parameters as described in these Wouter's slides: https://indico.cern.ch/event/254550/contributions/570045/attachments/445364/617689/atlas-stats-degenll-v2.pdf
I would like to do the analysis suggested by Wouter on p.15 but I can't find a way how to get the hessian matrix. He had a personal function giving him the matrix and I can't see anything like that implemented in https://root.cern.ch/doc/v608/classROOT_1_1Minuit2_1_1MnHesse.html...
I will appreciate your help a lot!
Best regards
RooMinimizer minim(*nll);
minim.setStrategy(2);
minim.setEps(0.0001);
minim.optimizeConst(2);
minim.minimize(“Minuit2”, “Migrad”);
ROOT::Minuit2::Minuit2Minimizer m2minim = static_castROOT::Minuit2::Minuit2Minimizer*(minim->fitter()->GetMinimizer());
double h = new double[10nn];
m2minim->GetHessianMatrix(h);
In the fit, the hessian matrix was forced to be positive definite. With the procedure above, I am retrieving the positive definite matrix (I checked that all its eigenvalues were positive). However, I would like to get the original hessian matrix. Is there a way how to do that? Is there a way how to retrieve the constant that was added to the diagonal elements when forcing the matrix to be pos. def.?
Thank you for your help in advance.
Best regards
Vojtech
The original matrix, before making it pos def, I think is deleted. You would need to patch yourself the code in
math/minuit2/src/MnHesse.cxx to store this matrix
There are some steps in the middle. The matrix you get is the inverse of the Covariance User matrix which is the one first computed by MnHesse using the second derivatives, then inverted (and made positive) and then transformed from internal to external coordinates in case you have bonds in the parameters
do I understand correctly that it is the covariance matrix that is
made positive definite and not the hessian matrix? Is it possible to say
how much does the matrix I get reflect properties of the original
hessian matrix?
The order is correct. There are eventually additional steps in case the parameter are bounded. In this case
transformations on the parameters are applied (e.g. p -> p’ = asin( 2 * (p-a)/(b-a) - 1) ) for a parameter p bound in the interval [a,b].
Minuit uses the internal (unlimited) parameters p’ and then transform it back the covariance matrix returned to the user