I am trying to fit the experimental data with the below equation but I am failing to get a good fit
This is the data
dataInput = Import["https://pastebin.com/raw/cLxyZbdy","TSV"]; (* Pastebin *)
(*dataInput = Import["C:\\Users\\Lenovo\\Documents\\VSM\\CR2O3\\fitting\\cr2o3-900-5k.DAT"]; *)
Or alternatively, here is a Google Drive link to my data file cr2o3-900-5k.DAT
Below is the code I am using
data = dataInput[[All, {1, 2}]]
P1 = ListLinePlot[data, PlotStyle -> Blue]
fm2 = NonlinearModelFit[
data, {(m*2)/π}*
ArcTan[(H + c)/c] Tan[(π (r/m))/2] + ϰ*
H, {{m, .00010, 1}, {c, 1*10^-5, 1*10^-3}, {r,
0.00001, .0001}, {ϰ, 0.0001, 1}}, H];
fm2@"BestFitParameters"
P2 = Plot[fm2[H], {H, -7, 7},
PlotStyle -> {Brown, AbsoluteThickness[2]}]
fm1 = NonlinearModelFit[
data, {(m*2)/π}*
ArcTan[(H - c)/c] Tan[(π (r/m))/2] + ϰ*
H, {{m, .00010, .1}, {c, 1*10^-5, 1*10^-7}, {r, 0.001,
0.0001}, {ϰ, 0.0001, 1}}, H];
fm1@"BestFitParameters"
P3 = Plot[fm1[H], {H, -7, 7}, PlotStyle -> {Red, AbsoluteThickness[2]}]
Show[P1, P2]
Show[P1, P3]
Show[P1, P2, P3]
fm1["AdjustedRSquared"]
fm1["RSquared"]
TableForm[fm1@"CorrelationMatrix", TableHeadings -> {{m, c, r, \[CurlyKappa]}, {m, c, r, \[CurlyKappa]}}]
to see that m and r are perfectly correlated, and m and chi are strongly correlated as well. $\endgroup$fm1["CorrelationMatrix"] // MatrixForm
andfm2["CorrelationMatrix"] // MatrixForm
. You'll see several perfect correlations among the parameter estimators. $\endgroup$