Re: Exponential fit question.
- To: mathgroup at smc.vnet.net
- Subject: [mg28005] Re: [mg27986] Exponential fit question.
- From: Ken Levasseur <Kenneth_Levasseur at uml.edu>
- Date: Wed, 28 Mar 2001 02:40:33 -0500 (EST)
- References: <200103270626.BAA21789@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Joe:
I don't get exactly what you report from Excel, but this is how I would
do it.
Ken Levasseur
Math Sciences
UMass Lowell
data = {{50, 22}, {64, 62}, {78, 122}, {93, 269}, {107, 414}, {122,
507}, {136, 597}}
Out[10]=
{{50, 22}, {64, 62}, {78, 122}, {93, 269}, {107, 414}, {122, 507}, {136,
597}}
In[11]:=
logdata = data /. {{a_, b_} -> {a, Log[b]}}
{{50, Log[22]}, {64, Log[62]}, {78, Log[122]}, {93, Log[269]}, {107,
Log[414]},
{122, Log[507]}, {136, Log[597]}}
In[12]:=
loglinearfit = Fit[logdata, {1, t}, t]
Out[12]=
0.0379875 t + 1.65305
In[13]:=
ExponentialModel = E^loglinearfit
Out[13]=
E^(0.03798745469454311*t + 1.6530511145849447)
In[14]:=
Simplify[ExponentialModel]
Out[14]=
5.222891180611702*E^(0.03798745469454311*t)
The following plot shows that your original data doesn't look very
exponential
eplot = Plot[ExponentialModel, {t, 0, 150},
Prolog -> {RGBColor[0, 0, 1], PointSize[0.02], Point /@ data}];
joe wrote:
> hello.
>
> I was wondering if someone could help me with the following problem.
>
> 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 ?
>
> Thanks.
> -Joseph.
- References:
- Exponential fit question.
- From: joe <joe@wam.umd.edu>
- Exponential fit question.