I am trying to fit correlation data into a non-linear model but it is not working. My data plot looks like this:
The equation I am using for fit is
The Mathematica script i am using looks like:
`(*Define the exponential decay model*)
model1[t_, a_, b_, c_, d_, e_, f_, g_, h_, i_, j_] :=
a (1 - b Exp[-t/c]) (1 + d Exp[-t/e]) (1 +
f Exp[-t/g]) (1 + h Exp[-t/i])/((1 + (t/j)) (1 + (0.04 t/j))^0.5)
(*Input data*)
newdata = {{-9.5, 0.987}, {-9.4, 1.141}, {-9.3, 1.139}, {-9.201,
1.097}, {-9.1, 1.12}, {-9.0, 1.088}, {-8.9, 1.101}, {-8.8,
1.123}, {-8.700000000000001, 1.123}, {-8.6, 1.143}, {-8.5,
1.161}, {-8.4, 1.171}, {-8.3, 1.203}, {-8.2, 1.211}, {-8.1,
1.204}, {-8.0, 1.18}, {-7.9, 1.187}, {-7.8, 1.196}, {-7.7,
1.184}, {-7.6000000000000005, 1.193}, {-7.5, 1.188}, {-7.4,
1.188}, {-7.3, 1.192}, {-7.2, 1.195}, {-7.1000000000000005,
1.194}, {-7.0, 1.195}, {-6.9, 1.197}, {-6.8, 1.198}, {-6.7,
1.204}, {-6.6000000000000005, 1.205}, {-6.5, 1.209}, {-6.4,
1.211}, {-6.3, 1.212}, {-6.2, 1.21}, {-6.1000000000000005,
1.212}, {-6.0, 1.21}, {-5.9, 1.21}, {-5.8, 1.209}, {-5.7,
1.208}, {-5.6000000000000005, 1.206}, {-5.5, 1.203}, {-5.4,
1.198}, {-5.3, 1.195}, {-5.2, 1.19}, {-5.1000000000000005,
1.185}, {-5.0, 1.18}, {-4.9, 1.173}, {-4.8, 1.167}, {-4.7,
1.16}, {-4.6000000000000005, 1.153}, {-4.5, 1.146}, {-4.4,
1.14}, {-4.3, 1.135}, {-4.2, 1.13}, {-4.1, 1.125}, {-4.0,
1.12}, {-3.9, 1.114}, {-3.8000000000000003, 1.107}, {-3.7,
1.1}, {-3.6, 1.092}, {-3.5, 1.084}, {-3.4,
1.076}, {-3.3000000000000003, 1.067}, {-3.2, 1.059}, {-3.1,
1.052}, {-3.0, 1.045}, {-2.9, 1.038}, {-2.8000000000000003,
1.033}, {-2.7, 1.028}, {-2.6, 1.024}, {-2.5, 1.021}, {-2.4,
1.018}, {-2.3000000000000003, 1.015}, {-2.2, 1.013}, {-2.1,
1.012}, {-2.0, 1.011}, {-1.9000000000000001, 1.01}, {-1.8,
1.009}, {-1.7, 1.009}, {-1.6, 1.008}, {-1.5,
1.008}, {-1.4000000000000001, 1.008}, {-1.3, 1.007}, {-1.2,
1.007}, {-1.1, 1.007}, {-1.0, 1.007}, {-0.9, 1.007}, {-0.8,
1.007}, {-0.7000000000000001, 1.007}, {-0.6, 1.007}, {-0.5,
1.007}, {-0.4, 1.007}, {-0.3, 1.007}, {-0.2, 1.007}, {-0.1,
1.006}};
(*Extract the x and y data*)
xData = newdata[[All, 1]];
yData = newdata[[All, 2]];
(*Perform curve fitting to find the best-fit values for a,b,and c*)
initialGuess = {1, 1, 1, 1, 1, 1, 1, 1, 1,
1}; (*Initial guess for parameters a,b,and c*)
nlm = NonlinearModelFit[newdata,
model1[t, a, b, c, d, e, f, g, h, i, j], {a, b, c, d, e, f, g, h,
i, j}, t, Method -> "LevenbergMarquardt"];
nlm[t]
` But I am not able to fit it. the table format of my raw data is as follows:
` X Y
______ _____
-9.5 0.987
-9.4 1.141
-9.3 1.139
-9.201 1.097
-9.1 1.12
-9 1.088
-8.9 1.101
-8.8 1.123
-8.7 1.123
-8.6 1.143
-8.5 1.161
-8.4 1.171
-8.3 1.203
-8.2 1.211
-8.1 1.204
-8 1.18
-7.9 1.187
-7.8 1.196
-7.7 1.184
-7.6 1.193
-7.5 1.188
-7.4 1.188
-7.3 1.192
-7.2 1.195
-7.1 1.194
-7 1.195
-6.9 1.197
-6.8 1.198
-6.7 1.204
-6.6 1.205
-6.5 1.209
-6.4 1.211
-6.3 1.212
-6.2 1.21
-6.1 1.212
-6 1.21
-5.9 1.21
-5.8 1.209
-5.7 1.208
-5.6 1.206
-5.5 1.203
-5.4 1.198
-5.3 1.195
-5.2 1.19
-5.1 1.185
-5 1.18
-4.9 1.173
-4.8 1.167
-4.7 1.16
-4.6 1.153
-4.5 1.146
-4.4 1.14
-4.3 1.135
-4.2 1.13
-4.1 1.125
-4 1.12
-3.9 1.114
-3.8 1.107
-3.7 1.1
-3.6 1.092
-3.5 1.084
-3.4 1.076
-3.3 1.067
-3.2 1.059
-3.1 1.052
-3 1.045
-2.9 1.038
-2.8 1.033
-2.7 1.028
-2.6 1.024
-2.5 1.021
-2.4 1.018
-2.3 1.015
-2.2 1.013
-2.1 1.012
-2 1.011
-1.9 1.01
-1.8 1.009
-1.7 1.009
-1.6 1.008
-1.5 1.008
-1.4 1.008
-1.3 1.007
-1.2 1.007
-1.1 1.007
-1 1.007
-0.9 1.007
-0.8 1.007
-0.7 1.007
-0.6 1.007
-0.5 1.007
-0.4 1.007
-0.3 1.007
-0.2 1.007
-0.1 1.006`
**What's happening here? How can I accurately fit the data? ** The references for a sample paper where similar data has been curve fitted are :
NonlinearModelFit[newdata, model1[t, a, b, c, d, e, f, g, h, i, j], {{a, 1}, {b, 1}, {c, 1}, {d, 1}, {e, 1}, {f, 1}, {g, 1}, {h, 1}, {i, 1}, {j, 1}}, t]
but replace all 1s with your initial values. $\endgroup$t
, whereas the x-values in your data areLog[t]
. $\endgroup$