Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'NonlinearModelFit does not fit correctly' topicStudent Support Forum > General > Archives > "NonlinearModelFit does not fit correctly"

Next Comment >Help | Reply To Topic
Author Comment/Response
JC
06/05/12 05:31am

Dear all,
I have some data that I want to fit to a broken power law. I use the following:
NonlinearModelFit[{{8.*10^9, 2.85}, {8.*10^9, 3.27}, {8.*10^9,
3.29}, {1.5*10^10, 2.33}, {1.5*10^10, 2.33}, {1.5*10^10,
2.63}, {1.5*10^10, 2.75}, {1.5*10^10, 2.92}, {1.5*10^10,
3.08}, {2.2*10^10, 1.82}, {2.2*10^10, 2.1}, {2.2*10^10,
2.1}, {2.2*10^10, 2.35}, {2.2*10^10, 2.5}, {2.2*10^10,
3.22}, {4.3*10^10, 1.39}, {4.3*10^10, 1.39}, {4.3*10^10,
1.75}, {2.2*10^11, 1.95}, {5.*10^14, 0.000478}, {5.*10^14,
0.000478}, {5.*10^14, 0.000631}, {5.*10^14, 0.001037}, {5.*10^14,
0.001066}, {5.*10^14, 0.001306}, {8.9*10^14, 0.000475}, {1.1*10^15,
0.000201}, {1.1*10^15, 0.000306}, {1.1*10^15,
0.000306}, {1.1*10^15, 0.000328}, {1.3*10^15,
0.000137}, {1.3*10^15, 0.000137}, {1.3*10^15, 0.00016}, {1.3*10^15,
0.000226}},
eta^-c1 (1 + eta/etabreak)^-c2 G0, {{etabreak, 20000000000000}, {c1,
0.4}, {c2, 1.2}, {G0, 30000}}, eta, Method -> Automatic]

The result that this yields is as follows (also given by FindFit):
eta0 -> 2.78704*10^20
c1 -> 0.290746
c2 -> 1.62933*10^6
G0 -> 2367.92

Residuals seem to be OK

{-0.27652, 0.14348, 0.16348, -0.27417, -0.27417, 0.0258297, 0.14583, \
0.31583, 0.47583, -0.509654, -0.229654, -0.229654, 0.0203462, \
0.170346, 0.890346, -0.52698, -0.52698, -0.16698, 0.758641, \
-0.00630207, -0.00630207, -0.00614907, -0.00574307, -0.00571407, \
-0.00547407, -0.000111472, 0.0000394432, 0.000144443, 0.000144443, \
0.000166443, 0.0000891977, 0.0000891977, 0.000112198, 0.000178198}

However, when I plot these (ListLogLogPlot), the adjusted fit is absolutely unrelated with the data by several orders of magnitude. Moreover, if I try to adjust a trial function by hand, the values that give me a reasonable fit are as follow:
eta0 ~ 2e13
c1 ~ 0.4
c2 ~ 1.2
G0 ~ 30 000

From this I conclude that Mathematica is not simply giving another fit equally valid, but it is providing me a totally wrong result.

Of course, I include my estimates as initial guesses for either FindFit or NonlinearModelFit. I have also tried to change the initial parameters using Manipulate, or changing the method (which most of the times gives me a bunch of errors such as overflows (QuasiNewton) or nonrealnumbers (NMinimize), for example.

What am I doing wrong here?

Thank you very much,
JC

Attachment: Untitled.nb, URL: ,

Subject (listing for 'NonlinearModelFit does not fit correctly')
Author Date Posted
NonlinearModelFit does not fit correctly JC 06/05/12 05:31am
Re: NonlinearModelFit does not fit correctly Michael 06/05/12 4:01pm
Next Comment >Help | Reply To Topic