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 this question on Cross Validated that the person rescaled the covariance matrix using the "number of measurements" but I don't know what that means.
I realise this question is basically a duplicate of a previous question, 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.