MathGroup Archive 1995

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

Search the Archive

Re: Exponetial Fit


In article <3ui5dj$231 at news0.cybernetics.net> crunch at s-cwis.unomaha.edu (John L. White) writes:

>        I have tried to do a exponetial fit to a list of data from a physics
>experiment, but Mathematica does a terrible job when I do the following 
>command:  

>Exp[Fit[Log(data),{1,t},t]]

Depending on what you mean by an exponential fit, there are some better
ways.  

If you want to find the best fit of the form y = A Exp[B x], try

logy[{x_,y_}] := {x, Log[y]}
logpoints = Map[logy, points] //N
Exp[Fit[logpoints, {1,x}, x]]

This gives the correct answer for 

points = {{1, 3 Exp[2]}, {2, 3 Exp[4]}, {3, 3 Exp[6]}}
(* f[x] = 3 Exp[2 x] *)

If you want to find the best fit of the form y = A x^B, try

logpoints = Map[logy, points] //N
Exp[Fit[logpoints, {1, Log[x]}, x]]

This gives the correct answer for

points = {{1, 3}, {2, 12}, {3, 27}, {4, 48}}
(* f[x] = 3 x^2 *)


I hope that helps.  - Hein Hundal



  • Prev by Date: [Q] weighted regression with Regress
  • Next by Date: New Protocol for Mathematica when using Windows 95
  • Previous by thread: Re: Exponetial Fit
  • Next by thread: Re: Re: ReadDigits