Exercise 3.3.22. Given measurements of at use least squares to find the line of best fit of the form .
Answer: This corresponds to a system as follows:
To find the least squares solution we form the system . We have
The system is then
From the second equation we have and from the first equation we have . The line of best fit is therefore .
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.