Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

FindFit bug

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116055] FindFit bug
  • From: Igor <igor.volkov at gmail.com>
  • Date: Mon, 31 Jan 2011 03:23:20 -0500 (EST)

Hello,
It seems that FindFit cannot fit a sine function.
It produces no warnings and gives a totally
wrong answer:

dat = Table[{t, 3 Sin[3 t + 1]}, {t, -3, 3, 0.1}];

fit = FindFit[dat, a Sin[w t + f], {a, w, f}, t]

Show[ListPlot[dat], Plot[a Sin[w t + f] /. fit, {t, -3, 3}]]

Output: {a -> 0.599211, w -> 1.51494, f -> 3.80421}

At the same time it fits Sin[3t+1] just fine.


  • Prev by Date: Re: Problems integrating InterpolatingFunction
  • Next by Date: Re: Anyone know of a book on Mathematica suitable for 16-18year old?
  • Previous by thread: Re: Mathematica 8 Home Edition
  • Next by thread: Re: Anyone know of a book on Mathematica suitable for 16-18year old?