Re: curve fitting
- To: mathgroup at smc.vnet.net
- Subject: [mg40849] Re: [mg40809] curve fitting
- From: Ian Brooks <ianbrooks at earthlink.net>
- Date: Tue, 22 Apr 2003 06:43:07 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Forget comparisons with Excel. If you are trying to do anything remotely non-trivial Excel is almost certainly giving you garbage. If you think I am exaggerating, take a look at the papers by Bruce McCullough who ran the NIST (National Institutes of Standards and Technology) statistics benchmark suite through Excel. The results are appalling, but not surprising. I don't have the paper to hand, but from memory of the 26 non-linear curve fitting problems posed Excel gave COMPLETELY wrong answers to 21 of them!!! By completely wrong, I mean that where the benchmark value is something like 0.6 Excel gave the answer as 13! If you need the reference I will try to dig it out. Ian >please look at the following mathematica code which I actually got from some >of the good people on this newsgroup. The plot obtained in the last line of >the code, does not really look exactly line the plot given by Microsoft >EXcel. Can anyone explain what they are different ? Is it possible to obtain >an interpolation function for the plot the way it appears in Excel? > >Are there any ways in Mathematica of getting information about the errors in >the curve fitting? > > > >data = {{0, 3.786392146}, {15, 3.81806915}, {30, 3.880044496}, {45, > 4.31622824}, {60, 4.523878538}, {90, 4.900042894}, {120, > 5.175422767}, {150, 5.217956939}, {180, 5.262434094}, {240, > 5.377787989}, {300, 5.36486329}, {360, 5.241879526}, {420, > 5.234405371}, {480, 5.228778272}, {540, 5.219441168}, {600, > 5.230700617}, {660, 5.305355251}, {720, 5.41936145}, {780, > 5.50345499}, {840, 5.524101499}, {900, 5.546731139}, {960, > 5.498010869}, {1020, 5.574792174}, {1080, 5.600864814}, {1140, > 5.589530789}, {1200, 5.537377461}, {1260, 5.455131015}, {1320, > 5.342847014}, {1380, 5.344745156}, {1440, 5.344745156}} > > ><< NumericalMath`NIntegrateInterpolatingFunct` > >f = Interpolation[data] > >NIntegrateInterpolatingFunction[f[x], {x, 0, 1440}] > >xmin = Min[data[[All, 1]]] >xmax = Max[data[[All, 1]]] > > >Plot[f[x], {x, xmin, xmax}, >PlotStyle -> RGBColor[0, 0, 1], >Epilog -> {AbsolutePointSize[5], >RGBColor[1, 0, 0], Point /@ data}, >ImageSize -> 400]