Hey guys,
I've been working for a couple days with the Levenberg-Marquardt "Nonlinear Curve Fit.vi" in Labview 8.20. I'm reasonably familiar with Labview, but I'm pretty new to fitting and statistics in general so I hope you guys can help me out. I read through the other posts on this vi, but didn't see my particular problem there.
I am trying to fit my experimental data with the function Y(x) = (k1+k2*x^m)*(1-x^n); so there are 4 parameters (k1, k2, m, and n).
I originally was doing my fitting in a graphing program called SigmaPlot that also uses the Levenberg-Marquardt method for fitting. With SigmaPlot, I get a pretty good fit (R^2 = 0.9999) in only 17 iterations with reasonable initial guesses. I wanted to move the analysis to Labview since there is a lot of data manipulation that occurs before the fit that I would like to automate instead of doing it manually in spreadhseet programs. But when I try to perform the same fit in Labview, the best fit I get is R^2 = 0.990 and that is starting with the optimum values from the SigmaPlot fit and I have to have several hundred iterations to get to this fit.
So I'm wondering what the differences are between these two programs. I figure, even if both are using the same method, there are probably still some differences in the way the method is implemented. The only options within the SigmaPlot program are StepSize and Tolerance, which I have set to 0.1 and 0.0001 respectively. I have tried adjusting the tolerance in Labview, but it doesn't seem to make much difference between 1E-4 and 1E-12 except for run time to get the same fit.
I've attached a zip with both a simplified form of my vi and a pdf image of my fit from SigmaPlot in case that helps. I saved the data into the array control to make the example easier. I have tried both the function as a formula string and as a vi and that didn't seem to make any difference, but at least gives me a little more info coming out of the fit.
So I'd appreciate any suggestions you guys have. Thanks,
-Tim