title: Getting covariance matrix when using Levenberg-Marquardt (lsqcurvefit) in MATLAB
body: <p>I am using the lsqcurvefit function in Matlab to model some experimental data. The data takes a specific shape and so the algorithm is just adjusting the coefficients of this shape to change its amplitude etc. </p>
  
  <p>The model works fine and gives a good fit (I have calculated chi-sq). Other implementations of the Levenberg-Marquardt algorithm give covariance as an output but in Matlab it is not an option for output (only 1st order optimality, no of iterations, Lambda and Jaccobian along with the bounds) .</p>
  
  <p>Does anybody know how to calculate the covariance matrix either from the outputs given (I'm not 100% on what use lambda and jaccobian could be or 1st order optimallity) by lsqcurvefit or independantly? </p>
  
  <p>Any help would be greatly appreciated, thanks!</p>