1
$\begingroup$

I am facing trouble in fitting some datasets with a model equation. Following is one of the data and code which I have tried:

 dataset={{77.1423, 6.15255}, {79.0708, 6.07519}, {80.9994, 5.13773}, {82.9279,
       4.39191}, {84.8565, 3.61991}, {86.7851, 2.27498}, {88.7136, 
      1.10707}, {90.6422, 0.770474}, {92.5707, 0.94292}, {94.4993, 
      1.14534}, {96.4278, 1.22016}, {98.3564, 1.16577}, {100.285, 
      1.01079}, {102.214, 0.871859}, {104.142, 0.73412}, {106.071, 
      0.602625}, {107.999, 0.344536}, {109.928, -0.0485628}, {111.856, -0.270411}, {113.785, \
    -0.267609}, {115.713, -0.299588}, {117.642, -0.385088}, {119.571, \
    -0.481319}, {121.499, -0.718893}, {123.428, -1.09099}, {125.356, \
    -1.42145}, {127.285, -1.65293}, {129.213, -1.94233}, {131.142, \
    -2.3921}, {133.07, -2.85897}, {134.999, -3.26016}, {136.928, \
    -3.7316}, {138.856, -4.27471}, {140.785, -4.63358}, {142.713, \
    -4.68778}, {144.642, -4.61687}, {146.57, -4.6557}, {148.499, \
    -4.82421}, {150.427, -5.03025}, {152.356, -5.2466}, {154.285, \
    -5.45688}, {156.213, -5.54296}, {158.142, -5.41875}, {160.07, \
    -5.19895}, {161.999, -5.03262}, {163.927, -4.94299}, {165.856, \
    -4.92012}, {167.784, -4.95004}, {169.713, -5.00008}, {171.642, \
    -5.07366}, {173.57, -5.1642}, {175.499, -5.21991}, {177.427, \
    -5.25822}, {179.356, -5.29985}, {181.284, -5.28828}, {183.213, \
    -5.20922}, {185.141, -5.15489}, {187.07, -5.204}, {188.999, \
    -5.33093}, {190.927, -5.48249}, {192.856, -5.69276}, {194.784, \
    -5.96753}, {196.713, -6.19466}, {198.641, -6.32324}, {200.57, \
    -6.44856}, {202.498, -6.6181}, {204.427, -6.76566}, {206.356, \
    -6.84361}, {208.284, -6.84087}, {210.213, -6.7554}, {212.141, \
    -6.62481}, {214.07, -6.53775}, {215.998, -6.56312}, {217.927, \
    -6.70954}, {219.855, -6.93804}, {221.784, -7.17837}, {223.713, \
    -7.41001}, {225.641, -7.66779}, {227.57, -7.97648}, {229.498, \
    -8.30832}, {231.427, -8.57684}, {233.355, -8.72391}, {235.284, \
    -8.80706}, {237.212, -8.90425}, {239.141, -9.01756}, {241.07, \
    -9.09653}, {242.998, -9.13624}, {244.927, -9.19635}, {246.855, \
    -9.3039}, {248.784, -9.41853}, {250.712, -9.51682}, {252.641, \
    -9.58518}, {254.569, -9.61863}, {256.498, -9.67902}, {258.427, \
    -9.80334}, {260.355, -9.9383}, {262.284, -10.0484}, {264.212, \
    -10.152}, {266.141, -10.2641}, {268.069, -10.3884}, {269.998, \
    -10.5218}, {271.927, -10.6461}, {273.855, -10.7506}, {275.784, \
    -10.8457}, {277.712, -10.9465}, {279.641, -11.0464}, {281.569, \
    -11.12}, {283.498, -11.1524}, {285.426, -11.1682}, {287.355, \
    -11.1746}, {289.284, -11.1503}, {291.212, -11.1265}, {293.141, \
    -11.1501}, {295.069, -11.1953}, {296.998, -11.2218}, {298.926, \
    -11.2361}, {300.855, -11.2708}, {302.783, -11.3274}, {304.712, \
    -11.3617}, {306.641, -11.3566}, {308.569, -11.3569}, {310.498, \
    -11.3837}, {312.426, -11.4165}, {314.355, -11.4469}, {316.283, \
    -11.4647}, {318.212, -11.4315}, {320.14, -11.3608}, {322.069, \
    -11.305}, {323.998, -11.2707}, {325.926, -11.2336}, {327.855, \
    -11.1959}, {329.783, -11.1702}, {331.712, -11.1496}, {333.64, \
    -11.1139}, {335.569, -11.0639}, {337.497, -11.0279}, {339.426, \
    -11.0152}, {341.355, -11.0223}, {343.283, -11.03}, {345.212, \
    -11.0029}, {347.14, -10.9501}, {349.069, -10.9178}, {350.997, \
    -10.9157}, {352.926, -10.9283}, {354.854, -10.9563}, {356.783, \
    -10.9855}, {358.712, -10.9946}, {360.64, -10.9933}, {362.569, \
    -11.0017}, {364.497, -11.019}, {366.426, -11.0092}, {368.354, \
    -10.9437}, {370.283, -10.8389}, {372.211, -10.7424}, {374.14, \
    -10.6946}, {376.069, -10.6855}, {377.997, -10.6883}, {379.926, \
    -10.6759}, {381.854, -10.6357}, {383.783, -10.5782}, {385.711, \
    -10.5241}, {387.64, -10.4792}, {389.568, -10.439}, {391.497, \
    -10.3999}, {393.426, -10.3577}, {395.354, -10.3155}, {397.283, \
    -10.2512}, {399.211, -10.152}, {401.14, -10.0568}, {403.068, \
    -9.99627}, {404.997, -9.94684}, {406.925, -9.88798}, {408.854, \
    -9.83471}, {410.783, -9.78906}, {412.711, -9.72607}, {414.64, \
    -9.63513}, {416.568, -9.54189}, {418.497, -9.46758}, {420.425, \
    -9.39722}, {422.354, -9.31796}, {424.283, -9.25458}, {426.211, \
    -9.24258}, {428.14, -9.26846}, {430.068, -9.30252}, {431.997, \
    -9.3342}, {433.925, -9.34365}, {435.854, -9.33585}, {437.782, \
    -9.34916}, {439.711, -9.38784}, {441.64, -9.43055}, {443.568, \
    -9.48583}, {445.497, -9.56078}, {447.425, -9.62055}, {449.354, \
    -9.63535}, {451.282, -9.65215}, {453.211, -9.73415}, {455.139, \
    -9.85499}, {457.068, -9.98476}, {458.997, -10.1349}, {460.925, \
    -10.284}, {462.854, -10.411}, {464.782, -10.5271}, {466.711, \
    -10.6344}, {468.639, -10.7353}, {470.568, -10.841}, {472.496, \
    -10.9487}, {474.425, -11.0372}, {476.354, -11.095}, {478.282, \
    -11.12}, {480.211, -11.1491}, {482.139, -11.2279}, {484.068, \
    -11.3258}, {485.996, -11.396}, {487.925, -11.4581}, {489.853, \
    -11.5343}, {491.782, -11.6217}, {493.711, -11.7394}, {495.639, \
    -11.8638}, {497.568, -11.9338}, {499.496, -11.9609}, {501.425, \
    -11.9969}, {503.353, -12.0324}, {505.282, -12.0412}, {507.21, \
    -12.0533}, {509.139, -12.104}, {511.068, -12.1521}, {512.996, \
    -12.1287}, {514.925, -12.0467}, {516.853, -11.9666}, {518.782, \
    -11.8911}, {520.71, -11.8004}, {522.639, -11.7164}, {524.567, \
    -11.664}, {526.496, -11.624}, {528.425, -11.5474}, {530.353, \
    -11.4336}, {532.282, -11.3377}, {534.21, -11.3004}, {536.139, \
    -11.3316}, {538.067, -11.4571}, {539.996, -11.6314}, {541.924, \
    -11.7594}, {543.853, -11.8153}, {545.782, -11.8233}, {547.71, \
    -11.7983}, {549.639, -11.7653}, {551.567, -11.7364}, {553.496, \
    -11.6937}, {555.424, -11.6345}, {557.353, -11.5984}, {559.281, \
    -11.6372}, {561.21, -11.767}, {563.139, -11.9548}, {565.067, \
    -12.1371}, {566.996, -12.3143}, {568.924, -12.5586}, {570.853, \
    -12.9642}, {572.781, -13.6004}, {574.71, -14.3379}, {576.638, \
    -14.8933}, {578.567, -15.1593}, {580.496, -15.1311}, {582.424, \
    -14.957}, {584.353, -14.8884}, {586.281, -15.0185}, {588.21, \
    -15.4133}, {590.138, -15.9642}, {592.067, -16.3131}, {593.996, \
    -16.3236}, {595.924, -16.1596}, {597.853, -15.9219}, {599.781, \
    -15.6746}, {601.71, -15.4659}, {603.638, -15.296}, {605.567, \
    -15.1582}, {607.495, -15.0534}, {609.424, -14.9752}, {611.353, \
    -14.92}, {613.281, -14.863}, {615.21, -14.7979}, {617.138, -14.7311}, \
    {619.067, -14.6079}, {620.995, -14.3682}, {622.924, -14.0509}, \
    {624.852, -13.752}, {626.781, -13.4726}, {628.71, -13.1274}, \
    {630.638, -12.6261}, {632.567, -11.9306}, {634.495, -11.18}, \
    {636.424, -10.6152}, {638.352, -10.3213}, {640.281, -10.3181}, \
    {642.209, -10.4359}, {644.138, -10.4108}, {646.067, -10.1934}, \
    {647.995, -9.75536}, {649.924, -9.18809}, {651.852, -8.81509}, \
    {653.781, -8.76218}, {655.709, -8.84958}, {657.638, -8.95102}, \
    {659.566, -9.02916}, {661.495, -9.07156}, {663.424, -9.08942}, \
    {665.352, -9.10871}, {667.281, -9.1363}, {669.209, -9.15924}, \
    {671.138, -9.16609}, {673.066, -9.17319}, {674.995, -9.19258}, \
    {676.923, -9.22147}, {678.852, -9.27194}, {680.781, -9.34755}, \
    {682.709, -9.43262}, {684.638, -9.51015}, {686.566, -9.58526}, \
    {688.495, -9.66724}, {690.423, -9.7348}, {692.352, -9.77369}, \
    {694.28, -9.80729}, {696.209, -9.85325}, {698.138, -9.90164}, \
    {700.066, -9.93902}, {701.995, -9.98959}, {703.923, -10.0917}, \
    {705.852, -10.2383}, {707.78, -10.3768}, {709.709, -10.4748}, \
    {711.637, -10.521}, {713.566, -10.5252}, {715.495, -10.5284}, \
    {717.423, -10.5477}}
model=NonlinearModelFit[dataset,
 {y0 + (A1*\[Omega]1*\[Nu]^2)/( \[Nu]^2*(\[Omega]1)^2 + \[Pi]^2*((\
\[Nu]1)^2 + (\[Omega]1)^2/(4*\[Pi]^2) - \[Nu]^2)^2) + (
   A2*\[Omega]2*\[Nu]^2)/( \[Nu]^2*(\[Omega]2)^2 + \
\[Pi]^2*((\[Nu]2)^2 + (\[Omega]2)^2/(4*\[Pi]^2) - \[Nu]^2)^2) + (
   A3*\[Omega]3*\[Nu]^2)/( \[Nu]^2*(\[Omega]3)^2 + \
\[Pi]^2*((\[Nu]3)^2 + (\[Omega]3)^2/(
        4*\[Pi]^2) - \[Nu]^2)^2), \[Nu]1 > 0 && \[Omega]1 > 
    0 && \[Nu]2 > 0 && \[Omega]2 > 0 && \[Nu]3 > 0 && \[Omega]3 > 
    0}, {{A1, -5080}, {\[Omega]1, 200}, {\[Nu]1, 
   120}, {A2, -8605}, {\[Omega]2, 550}, {\[Nu]2, 
   385}, {A3, -5080}, {\[Omega]3, 500}, {\[Nu]3, 595}, y0}, \[Nu], 
 PrecisionGoal -> 2]

now sometime it works, sometimes it returns with the error "eit" "the algorithm does not converge to the tolerance....". I understand the issue that I could not provide the guess value properly. In this context I have a few questions: (a) what is the elegant way in choosing the guess value if I donot have any idea about the values of the parameters? Has there any protocol/any command which can help me? (b)Has there any other options to fit the data with other method than "NonlinearModelFit/FindFit"? If so, please provide me atleast one example. (c) as far as I know that "Residuals", "AdjustedRSquared" are the common way to visualize the goodness of fit, but has there any other option to check? I am using Mathematica 9. Any help will be really helpful.

$\endgroup$
1
  • 1
    $\begingroup$ It appears you're fitting data with a set of 3 basis functions. The "trick" to getting better starting estimates is to figure out what each parameter brings to the party. The parameters $\nu_1$, $\nu_2$, and $\nu_3$ mark where the "peak" or "trough" of the basis function occurs. I don't see something obvious for the other parameters. Using a more recent version of Mathematica might also help. $\endgroup$
    – JimB
    May 24 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.