FindFit (beginner question)
- To: mathgroup at smc.vnet.net
- Subject: [mg63832] FindFit (beginner question)
- From: "Pete Fraser" <pfraser at covad.net>
- Date: Tue, 17 Jan 2006 04:33:26 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I'm trying to curve fit to a series of points with a Sin.
I started with a test set of points that actually lay on a Sin curve:
samples = Table[{i, Sin[i/4]}, {i, 0, 20}];
then used FindFit (even giving a hint on the amplitude):
f1 = FindFit[samples, a Sin[b x + c], {{a, 1}, b, c}, x]
I would have expected:
{a -> 1, b -> 0.25, c -> 0}
but actually got:
{a -> -0.125598, b -> 0.978835, c -> 1.984}
What am I doing wrong?
Thanks