title: Parameter uncertainties for scipy.optimize.minimize
body: <p>I fit a nonlinear function with several parameters using scipy.optimize.minimize to minimize the least-squares error. How do I find the variance of the parameters? I tried using the diagonal of the inverse of the Hessian, but the values are 100 times larger than the expected variances. I saw in <a href="http://stats.stackexchange.com/questions/93316/parameter-uncertainty-after-non-linear-least-squares-estimation">this question on Cross Validated</a> that the person rescaled the covariance matrix using the "number of measurements" but I don't know what that means. </p>
  
  <p>I realise this question is basically a duplicate of <a href="http://stackoverflow.com/questions/43593592/errors-to-fit-parameters-of-scipy-optimize">a previous question</a>, but that answer is not sufficient for me. In particular, the first answer says that the scipy.optimize.least_squares function returns the error on the parameters, which is untrue. The second answer does not address the case of least-squares minimization.</p>