Problems with NonlinearRegress
- To: mathgroup at smc.vnet.net
- Subject: [mg32204] Problems with NonlinearRegress
- From: Martin Duemling <mduemlin at quasar.phys.vt.edu>
- Date: Sat, 5 Jan 2002 00:10:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, I have the following problem: I try to do a Lorentzian-fit with my data. It works very good if the datas are simulated and very close to the ideal curve. But as soon as I use my real data (they have still Lorentzian shape) I don't get any result which makes sense (See example). Maybe somebody can help, Thank you. Martin Input: Clear["Global`*"] Needs["Statistics`NonlinearFit`"] data = ReadList["test4.txt", {Number, Number}]; fit2 = NonlinearRegress[data, \ Base + Amplitude/((1 + ((((freq - wo))/gamma))^2)), freq, {{Base, 0.8}, {Amplitude, 1}, {wo, 9}, {gamma, 0.009}}, Weights -> Equal, MaxIterations -> 100, WorkingPrecision -> 16, RegressionReport -> {ParameterTable, ANOVATable, EstimatedVariance}, AccuracyGoal -> 16, PrecisionGoal -> 16, ShowProgress -> True] Output Iteration:1 ChiSquared:37.193 Parameters:{0.8, 1., 9., 0.009} Iteration:2 ChiSquared:37.5594 Parameters:{0.863029, 17.9184, 11.1608, 0.0648881} Iteration:3 ChiSquared:38.099 Parameters:{0.878984, 46.7423, 16.506, 0.117541} Iteration:4 ChiSquared:38.7406 Parameters:{0.900703, 29.929, 22.6742, 0.096431} Iteration:5 ChiSquared:38.7053 Parameters:{0.901547, -25.3515, 44.1125, 0.0073759} ... And than the values are staying approx constant For comparison the correct values are (other fit program): Base= 0.65 Amplitude= 1.31 wo= 8.82 gamma= 0.008