MATH221 April 2013
• Q1 • Q2 (a) • Q2 (b) • Q2 (c) • Q2 (d) • Q3 • Q4 • Q5 • Q6 • Q7 (a) • Q7 (b) • Q7 (c) • Q8 • Q9 • Q10 • Q11 • Q12 (a) • Q12 (b) • Q12 (c) •
Question 11
|
Consider the follow matrix A and vector b:
Find the least squares solution x for the linear system Ax = b. Use this to find a linear function whose graph best fits the points (-1,0), (0,1), (1,2), and (2,2) in .
|
Make sure you understand the problem fully: What is the question asking you to do? Are there specific conditions or constraints that you should take note of? How will you know if your answer is correct from your work only? Can you rephrase the question in your own words in a way that makes sense to you?
|
If you are stuck, check the hints below. Read the first one and consider it for a while. Does it give you a new idea on how to approach the problem? If so, try it! If after a while you are still stuck, go for the next hint.
|
Hint 1
|
What is the dimension of the least square solution vector x?
|
Hint 2
|
The equation Ax = b is overdetermined, and does not have a solution. What we mean by least square solution x is the vector that satisfies
|
Hint 3
|
In order to find the least square solution solve the normal equations
|
Hint 4
|
Now that you know it is time to look at how the matrix A and the vector b were chosen. How does this relate to the equation of a line
Consider each of the four points, one at a time.
|
Checking a solution serves two purposes: helping you if, after having used all the hints, you still are stuck on the problem; or if you have solved the problem and would like to check your work.
- If you are stuck on a problem: Read the solution slowly and as soon as you feel you could finish the problem on your own, hide it and work on the problem. Come back later to the solution if you are stuck or if you want to check your work.
- If you want to check your work: Don't only focus on the answer, problems are mostly marked for the work you do, make sure you understand all the steps that were required to complete the problem and see if you made mistakes or forgot some aspects. Your goal is to check that your mental process was correct, not only the result.
|
Solution
|
Found a typo? Is this solution unclear? Let us know here. Please rate my easiness! It's quick and helps everyone guide their studies.
The least squares solution vector is a 2x1 vector. We can quickly find it using the normal equations.
To find from here we can either invert the matrix on the left hand side, or use gaussian elimination. We choose the latter.
Hence
Finally, how does this translate to the linear function whose graph best fits the four given points? In other words, find m and t such that
best fits the four given points (x1,y1), (x2,y2), (x3,y3), (x4,y4). To answer this we need to understand how the matrix A and the vector b were chosen. We notice that b holds the y values. Further, the x values of the points, are in the second column of A. The first column of A is ones and this is because the same constant t appears for each (x,y) pair. In matrix notation
Reading line by line reveals
for j = 1,2,3,4. Comparing to y = mx + t we obtain
The graph below is just for illustration purposes. It is not necessary to include a graph in your answer.
Therefore, the linear function is given by
|
Click here for similar questions
MER QGH flag, MER QGQ flag, MER QGS flag, MER QGT flag, MER Tag Least squares, Pages using DynamicPageList3 parser function, Pages using DynamicPageList3 parser tag
|
Math Learning Centre
- A space to study math together.
- Free math graduate and undergraduate TA support.
- Mon - Fri: 12 pm - 5 pm in LSK 301&302 and 5 pm - 7 pm online.
Private tutor
|