Re: Exponential fit question.
- To: mathgroup at smc.vnet.net
- Subject: [mg28036] Re: [mg27986] Exponential fit question.
- From: BobHanlon at aol.com
- Date: Wed, 28 Mar 2001 02:41:12 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Read the definition of Fit. You need to use NonlinearFit. Needs["Statistics`NonlinearFit`"]; data = {{50,22}, {64,62}, {78,122}, {93,269}, {107,414}, {122,507}, {136, 597}}; f[x_] := Evaluate[ NonlinearFit[data,a * Exp[b*x],{x}, {a, b}, Method -> Gradient]]; Plot[f[x], {x, 50, 140}, Axes -> False, Frame -> True, PlotStyle -> RGBColor[0, 0, 1], Epilog -> {RGBColor[0, 0, 1], Text[StringForm["f[x] = ``", f[x]], {135, f[135]}, {1, 0}], AbsolutePointSize[4], RGBColor[1, 0, 0], Point /@ data}, ImageSize -> {350, 200}]; Bob Hanlon In a message dated 2001/3/27 1:48:43 AM, joe at wam.umd.edu writes: >I am trying to perform an exponential fit to the following data >{{x,y}} > >data >={{50,22},{64,62},{78,122},{93,269},{107,414},{122,507},{136,597}} > >Fit[data,Exp[x],x] > >what I get is > >1.94272422061017735^-63 *E^x Which is not correct. > >With Excel I get 7.5*E^0.0034x which is correct. > >How can I do this with Mathematica ? >