When I looked into how the error calculation is done for lmfit when we fit functions, I found that the covariance matrix is calculated as the inverse of Hessian Matrix * 2. Then, the error on each parameter is calculated as the sqrt of the covariance matrix (after some scaling by reduced chi2). Where does this factor of two come from? Line 763 of this source is where I am referring to. I looked for some explanations but have not been able to find anything that explains this online.
Thank you for your help!