Programmatically check fit success

What is the recommended way to ensure that a fit was successful? That is, I want to ensure it converged and its error matrix is positive-definite. Details below.

RooFitResult::status returns the MINUIT status code, but there is a bug that means I am getting status=0 even if the covariance matrix was forced positive-definite. (See below)

RooFitResult::covQual seems like a possible workaround, but I cannot find documentation for the codes (apparently a common problem).

I can extract the error matrix using RooFitResult::covarianceMatrix or correlationMatrix, but I haven’t found a built-in method to determine whether it’s positive definite, much less whether it was forced positive definite.

Regarding the above bug in RooFitResult::status, I have fit results where RooFitResult::status()==0 and RooFit::Print says that the covariance matrix was forced positive-definite. An old forum answer says that this should not happen, that the status should be 1 in this case, so this seems to be a bug. That said, the codes are not well documented, so perhaps I’ve missed something.

Dear @mwilkins ,

Thanks for reaching out to us! I will let @jonas or @moneta help you on this one.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.


When the status=0 it means the covariance matrix is fine and it was not made pos defined. It is possible that during the minimization a temporary covariance matrix (note at the minimum) was made pos def. If this is not the case, I would like to look at this in more detailed, looking for example at the full log of the minimization or having an example reproducing this problem.
For the meaning of covQual see here (if using Minuit2).