Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to use fit' topicStudent Support Forum > General > Archives > "How to use fit"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Peter Pein
10/02/08 3:28pm

In Response To 'Re: How to use fit'
---------
Yehuda's solution ignores the c in Dr Elof's model.
I would recommend FindFit in place of Fit:

Block[
{mypoints={{1,2},{2,6},{6,5}},x,f1,f2,model,lbl},
f1=Fit[mypoints,{1,Sin[x+1]},x];
f2=FindFit[mypoints,model=a+b Sin[x+c],{a,b,c},x];
Plot[Evaluate[{f1,lbl=model/.f2}],{x,1,6},
Epilog->{PointSize[.02],Red,Point/@mypoints},
PlotRange->{{0,7},{0,15}},
PlotStyle->Blue,Darker[Green]},
PlotLabel->Column[
{Style[f1,FontColor->Blue],
Style[lbl,FontColor->Darker[Green]]}]]]

Cheers,
Peter

URL: ,

Subject (listing for 'How to use fit')
Author Date Posted
How to use fit Dr.Elof 09/29/08 3:12pm
Re: How to use fit yehuda ben-s... 10/01/08 3:46pm
Re: Re: How to use fit Peter Pein 10/02/08 3:28pm
< Previous CommentHelp | Reply To Comment | Reply To Topic