I have the following numbers
l={38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37,
37, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 32, 31, 29, 29, 29, 28,
28, 28, 28, 27, 26, 25, 23, 21, 21, 16, 15, 15, 15, 11, 10, 6, 5, 4,
4, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0}
which look like an error function. I'd like to automatically find a fit for these numbers. I tried two different approaches
Fit[l, {Erf[x], 1}, x]
and
FindFit[l, a Erf[b x - c] + d, {a, b, c, d}, x]
Both produce completely off results. As I have a lot of data lists, I'd very much appreciate to automatically find the fits for these data.



sol = FindFit[l, {a Erfc[b (z - c)], a > 10, 0 < b < 0.1, 30 < c < 60}, {a, b, c},z]which gives{a -> 18.1322, b -> 0.0740242, c -> 59.7275}thenShow[Plot[a Erfc[b (z - c)] /. sol, {z, 0, 100}], ListLinePlot[l], PlotRange -> All]. – Stephen Luttrell Feb 11 '14 at 18:31FindFitit says "In the nonlinear case, it finds in general only a locally optimal fit.", which means that it helps to impose constraints on the parameter values as I did. I didn't play with any of the possible settings for theMethodoption ofFindFit, so you might find a better approach hiding in there somewhere. – Stephen Luttrell Feb 11 '14 at 19:08