MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: curve fitting




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





  • Prev by Date: Re: How to draw an ellipse?
  • Next by Date: Re: Date in Header/Footer ??
  • Prev by thread: Re: curve fitting
  • Next by thread: How to draw an ellipse?