How to get Hessian Matrix from python minimize function?

Is there any way that we could get the Hessian matrix (so as to calculate the standard error) after getting the optimization result through scipy.minimize function? The parameter of hessian in the minimize function seems to be input instead of an output.

opt = minimize(logitfn, args = (df), x0=x_start,method = 'Nelder-Mead')

Solution 1:

Just in case later someone is faced with the same problem. Use 'L-BFGS-B' method, and then

''' opt.hess_inv.todense() '''