I have the following data which is postulated to have contributions from two different sources .....as can be seen from the confidence band, many points are out of the band. Question: How can I separate the data into two groups such that I can have 2 fitting curves with less data out of confidence band for each cluster?
data = {{17.63, 3794.90}, {19.88, 2410.30}, {21.67, 3282.10}, {23.92,
3153.80}, {24.37, 2846.20}, {24.82, 2487.20}, {25.27,
1692.30}, {26.16, 1564.10}, {27.06, 3205.10}, {27.06,
3692.30}, {27.51, 3384.60}, {29.76, 1307.70}, {30.20,
3615.40}, {31.10, 3282.10}, {33.80, 1179.50}, {40.53,
1051.30}, {47.27, 1871.80}, {47.71, 2589.70}, {49.51,
410.26}, {49.51, 3435.90}, {49.96, 1538.50}, {52.20,
410.26}, {52.65, 948.72}, {52.65, 1179.50}, {54.90,
717.95}, {55.35, 1384.60}, {55.35, 615.38}, {55.80,
846.15}, {56.69, 1897.40}, {57.14, 589.74}, {57.59,
2384.60}, {59.84, 2025.60}, {60.29, 538.46}, {60.29,
358.97}, {62.08, 538.46}, {62.98, 384.62}, {63.43,
1128.20}, {63.43, 615.38}, {63.88, 871.79}, {63.88,
717.95}, {64.78, 461.54}, {64.78, 1615.40}, {65.22,
3743.60}, {67.02, 794.87}, {68.82, 1538.50}, {70.16,
487.18}, {70.16, 897.44}, {72.86, 538.46}, {72.86,
641.03}, {73.76, 435.90}, {74.65, 1538.50}, {74.65,
1205.10}, {75.55, 769.23}, {76.00, 307.69}, {76.45,
410.26}, {76.90, 794.87}, {76.90, 641.03}, {76.90,
538.46}, {80.49, 820.51}, {81.84, 743.59}, {83.18,
512.82}, {86.33, 487.18}, {87.67, 384.62}, {88.12,
1102.60}, {89.02, 871.79}, {94.86, 461.54}, {95.31,
205.13}, {95.76, 333.33}, {96.65, 538.46}, {98.45,
256.41}, {98.45, 461.54}, {98.90, 128.21}, {99.80,
282.05}, {100.24, 666.67}, {100.69, 487.18}, {100.69,
384.62}, {100.69, 153.85}, {102.04, 564.10}, {102.04,
230.77}, {102.94, 974.36}, {102.94, 692.31}, {105.18,
512.82}, {105.18, 282.05}, {105.18, 974.36}, {106.08,
179.49}, {106.53, 1102.60}, {106.98, 615.38}, {107.43,
410.26}, {107.43, 333.33}, {111.92, 384.62}};
nlm = NonlinearModelFit[data, a Exp[-b (x - c)], {a, b, c}, x]
{bands95[x_], bands99[x_], bands999[x_]} =
Table[nlm["MeanPredictionBands",
ConfidenceLevel -> cl], {cl, {.85, .95, .999}}];
Show[ListPlot[data],
Plot[{nlm[x], bands95[x], bands95[x], bands99[x], bands999[x]}, {x,
1, 105}, Filling -> {2 -> {1}, 3 -> {2}, 4 -> {3}, 5 -> {4}}]]
data
for purposes of clarity. $\endgroup$a Exp[-b (x - c)]+ d Exp[-e (x - f)]
? $\endgroup$a Exp[-b(x-c)
ord Exp[-e(x-f]
? If this is the case you may need to come up with some criteria to separate the data, as Mathematica won't know a priori how to bin the data. $\endgroup$