 
 
 
 
 
 
Re: curve fitting
- To: mathgroup@smc.vnet.net
- Subject: [mg10387] Re: curve fitting
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Mon, 12 Jan 1998 04:10:18 -0500
- References: <694c2k$o1p@smc.vnet.net>
Paul.Hanson@colorado.edu wrote:
> I'm trying to fit a function of the form: f[x_]:= Exp^(a*x)
  In[1]:=
<< Statistics`NonlinearFit`
In[2]:=
f[x_]:= E^(1.234*x)
In[3]:=
data = Table[{x,( 1 + .2 (Random[]-.5)) f[x]},{x,.1, 1,.1}]
Out[3]=
{{0.1,1.19254},{0.2,1.24264},{0.3,1.32813},{0.4,1.78423},{0.5,1.95719},{0.6,
    1.89493},{0.7,2.14402},{0.8,2.71434},{0.9,3.33588},{1.,3.44723}}
In[4]:=
NonlinearFit[data,f[x], {x},{a}]
Out[4]=
E^(1.233999999999999*x)
E^(1.234 x)
--
Allan Hayes
Mathematica Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642

