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.