03-18-2013 09:42 AM
I am trying to fit a Voight profile using the LM Constrained Nonlinear Curve Fit so that I can extract the Gaussian and Lorentzian parameters. I am currently only using f(x,a) and it seems to work OK. I'm not very familiar with LM curve fitting but I wanted to try to use the gradient f ' (x,a) as well to see if it improves the robustness of the fit. I assumed that I would wire f ' (x,a) to just be the analytical derivative of the original convolution (using the derivative rule for convolutions). However I have only found one user example that used f ' (x,a) in the model file and it did not seem to be the derivative of f (x,a). I can't find any NI examples using f ' (x,a). Could someone point me in the right direction?
Thanks
Solved! Go to Solution.
03-19-2013 09:33 AM
Hi mpmarquez,
Here's a related forum post that should answer your question. Please let me know if you have any further questions!
http://forums.ni.com/t5/LabVIEW/Lev-Mar-fit-linear-baseline-4-gauss/td-p/1721134
-N
03-19-2013 10:23 AM
Thanks for the example. It seems to answer my question. I have one follow up question though. Someone mentioned in the thread you linked to that for fitting experimental data that the partial derivatives aren't required and that the numeric derivatives will suffice. Is that generally true?
03-19-2013 10:44 AM
I consider altenbach to be one of the experts on fitting on the Forums.
If you have a function which has poorly behaved derivatives, you might find it advantageous to do your own calculations. You could define the derivatives in a way which makes sense for your physical model in the neighborhood of a discontinuity if the numerical calulations failed. Gaussian and Lorentzian curves are smooth enough that I would not expect problems.
If you have already written a VI with the partial derivatives, you could always run comparisons using your data. Then post the results so others can benefit from what you learned.
Lynn
03-19-2013 12:36 PM
Thanks for the response. I am trying to extract laser linewidth information using a self-delayed heterodyne. It is possible that the data could be quite noisy which might appear discontinuous. So I was thinking that providing the gradient information might make it more robust. However maybe it would be easier to average the data instead.