I have a set of data, how can I fit the best function to that? i use FindFit and then I guess the function myself, but I want Mathematica to find the best fit. How can it be done?
y1 = {48.999, 57.180, 63.8421, 68.81, 72.228, 74.428, 75.782, 76.60,
77.138, 77.531, 77.886, 78.264, 78.697, 79.201, 79.784, 80.444,
81.180, 81.986, 82.857, 83.786, 84.7678, 85.796, 86.866, 87.974`,
89.113, 90.281, 91.474, 92.687`, 93.920, 95.167, 96.428, 97.700,
98.981, 100.268, 101.562, 102.859, 104.158, 105.460, 106.761,
108.062, 109.361, 110.658, 111.951};
y2 = Table[y2, {y2, 50, 470, 10}];
data = Transpose[{y2, y1}];
x1 = ListLinePlot[data]
FindFit[data, d x^4 + a x^3 + b x^2 + c x + f, {d, a, b, c, f}, x]
Show[ListPlot[data, PlotStyle -> Red],
Plot[d x^4 + a x^3 + b x^2 + c x +
f /. {d -> -1.2911673126124723`*^-8,
a -> 0.000014771971357899056`, b -> -0.005794083194578543`,
c -> 0.9998897221123239`, f -> 16.20821389434905`}, {x, 50, 500}]]