Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: NonlinearFit

  • To: mathgroup at
  • Subject: [mg49876] Re: NonlinearFit
  • From: Paul Abbott <paul at>
  • Date: Thu, 5 Aug 2004 09:20:38 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <ceqtcr$jrp$>
  • Sender: owner-wri-mathgroup at

In article <ceqtcr$jrp$1 at>, Andrew_Pollock at 

> I'm trying to fit an exponential function to a set of data using the
> following command:
> << Statistics`NonlinearFit`
> NonlinearFit[Data,theta1 Exp[theta2 x],x,{theta1,theta2}]
> Data is the following table, where the right column is 3*Exp[.2*x]
> (Embedded image moved to file: pic13984.pcx)
> [contact the author to get the file - moderator]
> NonlinearFit returns (Embedded image moved to file: pic03027.pcx), which is
> clearly not 3*Exp[.2*x].
> I only have this problem when trying to fit exponential functions.  Any
> suggestions?

  << Statistics`

  data = Table[{x, 3 E^(0.2 x)}, {x, -3, 3, 0.5}]

  NonlinearFit[data, a E^(b x), x, {a, b}]

In Version 5.0 you can use FindFit:
  FindFit[%, a E^(b x), {a, b}, x]

In both cases the original functional form is recovered.


Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at 

  • Prev by Date: New webMathematica Author Provides Authoring Environment for webMathematica
  • Next by Date: Re: NonlinearFit
  • Previous by thread: Re: NonlinearFit
  • Next by thread: Asymmetric quadratic coefficient problem