Exercise 3.3.24. Given the measurements at use least squares to find the line of best fit.
Answer: This corresponds to a system of the form as follows:
To find the least squares solution we multiply both sides by to create a system of the form . We have
so that the new system is
We can multiply the first equation by and subtract it from the second equation to form the system
From the second equation we have and can substitute into the first equation to get or
The line of best fit is thus .
NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.
If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fifth Edition and the accompanying free online course, and Dr Strang’s other books.