curve fitting
- To: mathgroup at smc.vnet.net
- Subject: [mg40809] curve fitting
- From: "C B" <cbhat at purdue.edu>
- Date: Sat, 19 Apr 2003 22:59:29 -0400 (EDT)
- Organization: Purdue University
- Sender: owner-wri-mathgroup at wolfram.com
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]