<< Graphics`MultipleListPlot`
<< 
      LinearAlgebra`MatrixManipulation`


    
x  =  {1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00} 
          (Pi/5);
y = 
        Table[
Sin[x[[i]]] + 
            If[0.5  <  Random[],  0.1  Random[],  -0.1 Random[]], {i, 
            1, Length[x]}];
sig = 
        Table[0.1  Random[], {i, 1, Length[x]}];
X  =  {1,  tmp,  (tmp^2), (tmp^3),  
          (tmp^4)};
Aij  =  
        Table[Evaluate[X[[j]] /. tmp  -> x [[i]]]/
            sig[[i]], 
{i,  1,  Length[x]}, {j, 1, 
            Length[X]}];
b  =  
        Table[y[[i]]/sig[[i]],  {i, 1, 
            Length[x]}];
transAij = Transpose[Aij];
tAijdotAij = Dot[transAij,  Aij];
intAijdAij = Inverse[tAijdotAij];
aa  =  
        Dot[intAijdAij,  Dot[transAij,  b]];
yfit  =  
        Table[aa[[1]] 1 + 
            aa[[2]] x[[i]] + 
aa[[3]] 
              x[[i]]^2 + aa[[4]] x[[i]]^3 + 
            aa[[5]] x[[i]]^4, {i, 1, 
            Length[x]}];
data = 
        Table[{x[[i]], y[[i]]},  {i, 1, 
            Length[x]}];
fit  =  
        Table[{x[[i]],  yfit[[i]]},  {i, 1, 
            Length[x]}];
MultipleListPlot[{data, fit}, 
      PlotJoined -> {False, 
          True}, 
AspectRatio -> 1, 
      PlotRange -> {{0, 2  Pi}, {-1.25, 
            1.25}}]
MatrixForm[aa]