MathGroup Archive 2004

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

Search the Archive

Re: NonlinearFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49887] Re: [mg49846] NonlinearFit
  • From: Yasvir Tesiram <yat at omrf.ouhsc.edu>
  • Date: Thu, 5 Aug 2004 09:21:06 -0400 (EDT)
  • References: <200408041446.KAA20115@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Seems to be no problem here. Copy and paste a representative sample of 
your real data in the body of your emails (say five well spaced 
points). In any case here is some synthetic data and solution using 
NonlinearFit and FindFit (new as of version 5)

<< Statistics`NonlinearFit`
<< Graphics`Colors`
<< Graphics`Graphics`

fitted = NonlinearFit[syndat, th1*Exp[th2*x], {x}, {th1, th2}]
p2 = Plot[fitted, {x, 0, 6}, PlotStyle -> Red, PlotRange -> All,

       Epilog -> Prepend[Point /@ syndat, PointSize[0.015]]


       ];



fittedUsingFindFit = FindFit[syndat, th1*Exp[th2*x], {th1,
      th2}, x, Method -> LevenbergMarquardt]

Cheers
Yas



On Aug 4, 2004, at 9:46 AM, Andrew_Pollock at rcomext.com wrote:

> Hello,
>
> I was hoping someone could help me with a problem I'm having with
> NonlinearFit.
>
> 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?
>
> Thanks,
> Andy


  • Prev by Date: Re: NonlinearFit
  • Next by Date: Re: populate a list with random numbers from normaldistribution?
  • Previous by thread: NonlinearFit
  • Next by thread: Re: NonlinearFit