Chapter 11 - Least-Squares Fits and Pseudoinverses

Section 11.3 - Least-Squares Fits and Pseudoinverses

Example 11.3.1

S={{415,13.25},{372,13.85},{391,13.60},{428,13.15},{403,13.65},{350,14.05},{362,13.90},{410,13.20},{385,13.60},{434,13.00},{465,12.75},{380,13.65}};

Sumx=Sum[S[[j,1]],{j,1,12}]

Sumy=Sum[S[[j,2]],{j,1,12}]

Sumxy=Sum[S[[j,1]] S[[j,2]],{j,1,12}]

Sumxsqrd=Sum[((S[[j,1]])^2),{j,1,12}]

(Coeffs={{Sumxsqrd,Sumx},{Sumx,12}})//MatrixForm

(RHS={{Sumxy},{Sumy}})//MatrixForm

Inverse[Coeffs].RHS//MatrixForm