Minimizing c2, cont’d.
Here are our two equations, rearranged. Note that all the quantities in parentheses can be computed directly from our data, so they are just numbers.
Using linear algebra or matrix
techniques, it is simple to invert
these equations to find A and B.
I won’t do it here, but will just
write the answer.
This is exactly what is done in
Linfit.xls, by the way, and you can look at it
By opening the file, clicking on “Tools”, then “Macros”, then the
Linfit macro, then “Edit”.  The Linfit macro is written in Basic and is relatively easy to follow.
The answer is: