Fitting Experiments

numdata=15;
degree=7;
data=Table[{i,Sqrt[i]+0.1*Sin[5i]+1},{i,0,numdata}];
funcs=Table[x^i,{i,0,degree}];

pic1=ListPlot[data];
datafit= Fit[data,funcs,x];
pic2=Plot[datafit,{x,0,numdata},PlotStyle->{Thickness[0.01`],GrayLevel[0.5`]}];

Show[{pic2,pic1}]

dow=FinancialData["IBM","Jan. 1, 1950"];
dowtran=Transpose[dow];
data=dowtran[[2]];

numdata=Length[data];
degree=1;

funcs=Table[x^i,{i,0,degree}];

pic1=ListPlot[data];
datafit= Fit[data,funcs,x];
pic2=Plot[datafit,{x,0,numdata},PlotStyle->{Thickness[0.01`],GrayLevel[0.5`]}];

Show[{pic1,pic2}]