0
$\begingroup$

I am trying to fit the following data with y axis on a log scale. I used the following model to fit the data but without success.

Can anyone help me suggest a proper model?

data = {{0.8000, 100000000.00}, {0.8028, 82008960.54}, {0.8028, 
    88704567.22}, {0.8028, 95569262.75}, {0.8065, 
    74930994.80}, {0.8074, 69005245.31}, {0.8112, 
    63795934.75}, {0.8130, 60149303.92}, {0.8148, 
    55175111.15}, {0.8176, 51210865.13}, {0.8194, 
    47345844.06}, {0.8231, 42586090.69}, {0.8268, 
    38154882.10}, {0.8296, 34589763.45}, {0.8324, 
    32230723.75}, {0.8379, 28876433.27}, {0.8407, 
    26178274.99}, {0.8482, 24011931.03}, {0.8500, 
    21768524.26}, {0.8546, 19811674.52}, {0.8583, 
    18316061.18}, {0.8648, 16474214.72}, {0.8685, 
    15170924.72}, {0.8741, 13807015.89}, {0.8825, 
    12664307.93}, {0.8843, 11662660.74}, {0.8908, 
    10824275.54}, {0.8974, 10125283.11}, {0.9001, 
    9143260.25}, {0.9076, 8485898.89}, {0.9160, 7875718.77}, {0.9187, 
    7367433.69}, {0.9262, 6837746.68}, {0.9308, 6346335.88}, {0.9392, 
    5959723.49}, {0.9467, 5596720.15}, {0.9523, 5214861.55}, {0.9597, 
    4820987.27}, {0.9690, 4319085.26}, {0.9783, 4071870.70}, {0.9821, 
    3764479.01}, {0.9942, 3521167.36}, {0.9998, 3293816.71}, {1.0053, 
    3069082.90}, {1.0128, 2904846.86}, {1.0203, 2760205.60}, {1.0287, 
    2571800.93}, {1.0361, 2424646.34}, {1.0473, 2206528.92}, {1.0585, 
    2008033.00}, {1.0697, 1863588.05}, {1.0809, 1729533.55}, {1.0920, 
    1567785.50}, {1.0995, 1478079.16}, {1.1126, 1393420.50}, {1.1191, 
    1313704.45}, {1.1265, 1248291.07}, {1.1377, 1144943.95}, {1.1508, 
    1083608.24}, {1.1592, 1009643.88}, {1.1676, 944425.49}, {1.1797, 
    886855.90}, {1.1928, 813415.74}, {1.2002, 785136.28}, {1.2123, 
    722957.14}, {1.2217, 681576.73}, {1.2319, 642558.29}, {1.2413, 
    615359.64}, {1.2497, 584713.04}, {1.2590, 555587.06}, {1.2702, 
    523775.85}, {1.2786, 493801.15}, {1.2907, 458275.61}, {1.3000, 
    437159.24}, {1.3084, 408920.75}, {1.3178, 390078.54}, {1.3290, 
    370640.22}, {1.3401, 343978.75}, {1.3551, 317972.40}, {1.3644, 
    302133.42}, {1.3747, 282611.22}, {1.3849, 264350.44}, {1.3989, 
    248231.30}, {1.4120, 233097.43}, {1.4213, 217184.57}, {1.4316, 
    203151.30}, {1.4465, 191511.68}, {1.4521, 180557.35}, {1.4624, 
    172912.83}, {1.4736, 162374.19}, {1.4838, 151882.47}, {1.4931, 
    145453.48}, {1.5043, 134990.50}, {1.5183, 126759.26}, {1.5258, 
    119038.43}, {1.5379, 113996.20}, {1.5445, 108746.82}, {1.5519, 
    104145.83}, {1.5613, 98958.08}, {1.5715, 94397.34}, {1.5808, 
    88645.84}, {1.5911, 84560.37}, {1.6004, 80348.21}, {1.6135, 
    75154.25}, {1.6266, 69746.72}, {1.6378, 66271.11}, {1.6462, 
    61990.30}, {1.6564, 58901.81}, {1.6667, 55529.84}, {1.6779, 
    52145.43}, {1.6881, 48776.08}, {1.6975, 46346.42}, {1.7087, 
    43692.77}, {1.7208, 40708.75}, {1.7311, 38832.58}, {1.7385, 
    36754.53}, {1.7469, 34787.33}, {1.7553, 33446.11}, {1.7628, 
    32156.92}, {1.7702, 30675.82}, {1.7796, 29033.67}, {1.7852, 
    27915.14}, {1.7936, 27050.26}, {1.8020, 26007.33}, {1.8085, 
    24907.24}, {1.8206, 23480.89}, {1.8299, 22311.25}, {1.8430, 
    20868.98}, {1.8542, 19674.09}, {1.8645, 18402.86}, {1.8766, 
    17417.18}, {1.8869, 16420.09}, {1.8999, 15178.96}, {1.9120, 
    14253.70}, {1.9214, 13385.24}, {1.9316, 12718.36}, {1.9438, 
    11849.75}, {1.9624, 10740.67}, {1.9811, 9659.32}, {1.9969, 
    8824.48}, {2.0137, 8125.21}, {2.0305, 7278.72}, {2.0483, 
    6728.21}, {2.0623, 6122.76}, {2.0762, 5704.49}, {2.0902, 
    5232.05}, {2.1052, 4855.49}, {2.1173, 4523.89}, {2.1285, 
    4298.45}, {2.1527, 3702.21}, {2.1807, 3188.55}, {2.2031, 
    2811.72}, {2.2293, 2421.66}, {2.2554, 2069.41}, {2.2796, 
    1839.18}, {2.2983, 1647.54}, {2.3151, 1511.05}, {2.3281, 
    1385.92}, {2.3505, 1261.09}, {2.3729, 1120.81}, {2.4000, 
    1000.00}}
ListLogPlot[data, Joined -> False]

Can anyone help me to model the above data?

$\endgroup$
  • 1
    $\begingroup$ You want to fit it or plot it or both? $\endgroup$ – zhk Apr 25 at 13:36
  • $\begingroup$ Try ListLogLogPlot. The trend is fairly linear if you don't care about a slight wobble. $\endgroup$ – Sjoerd Smit Apr 25 at 15:57
1
$\begingroup$

Actually I am trying to fit an equation using FindFit[data,model,{a,b,c,....},x]. I tried exponential, polynomial etc, but no equation fits properly to the above data. Can anyone suggest a model to fit the equation.

This can be done using Quantile Regression. The answer below uses the QRMon package.

Load the QRMon package:

Import["https://raw.githubusercontent.com/antononcube/MathematicaForPrediction/master/MonadicProgramming/MonadicQuantileRegression.m"]

Rescale the data:

data2 = Map[{#[[1]], Log[#[[2]]]} &, data];

Do a quantile regression fit and plot data, regression functions, and relative errors:

obj2 =
  QRMonUnit[data2] ⟹
   QRMonSetRegressionFunctionsPlotOptions[{PlotStyle -> Red}] ⟹
   QRMonQuantileRegression[8, 0.5] ⟹
   QRMonPlot[PlotRange -> All] ⟹
   QRMonErrorPlots;

enter image description here

Get the regression function from the monad object and show symbolic, simplified version of it:

qFunc2 = (obj2 ⟹ QRMonTakeRegressionFunctions)[0.5];
PiecewiseExpand[qFunc2[x]]

enter image description here

Define a function that rescales to the original co-domain:

qFunc = Exp@*qFunc2;

Plot the original data and the fitted function (with log-plots):

Show[{
  ListLogPlot[data, PlotStyle -> GrayLevel[0.65], 
   PlotTheme -> "Detailed", ImageSize -> Large], 
  ListLogPlot[{#, qFunc[#]} & /@ data[[All, 1]], 
   PerformanceGoal -> "Quality", Joined -> True, PlotStyle -> Red]}, PlotRange -> All]

enter image description here

First answer (made for clarification purposes)

It seems you get a reasonable result with ListLogPlot:

ListLogPlot[data, PlotRange -> All, PlotTheme -> "Detailed"]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks Anton. Actually I am trying to fit an equation using FindFit[data,model,{a,b,c,....},x]. I tried exponential, polynomial etc, but no equation fits properly to the above data. Can anyone suggest a model to fit the equation. $\endgroup$ – Ziauddin Ahmed Mohammed Apr 26 at 22:24

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.