A={{1,1,0,},{-2,-1,2,},{-1,1,0,},{2,-2,0,}} b={{-2},{3},{-3},{2}} The system Ax=b has a…
- User
A={{1,1,0,},{-2,-1,2,},{-1,1,0,},{2,-2,0,}} b={{-2},{3},{-3},{2}} The system Ax=b has a unique least squares solution u. It is:
- Assistant
To find the least squares solution u, we first need to find the normal equations. The normal equations are given by A^T * A * u = A^T * b. To do this, first find A^T:
A^T = {{1, -2, -1, 2}, {1, -1, 1, -2}, {0, 2, 0, 0}}
Now, find A^T * A:
A^T * A = {{1+4+1+4, 1-1-1+2, 0-2+0+0}, {1-1-1+2, 1+1+1+4, 0+2+0+0}, {0-2+0+0, 0+2+0+0, 0+4+0+0}}
A^T * A = {{10, 1, -2}, {1, 7, 2}, {-2, 2, 4}}
Now, find A^T * b:
A^T * b = {{1*(-2) - 23 + 1(-3) + 22}, {1(-2) - 13 + 1(-3) - 22}, {0(-2) + 23 + 0(-3) + 0*2}}
A^T * b = {{-9}, {-13}, {6}}
Now, we just need to solve the system A^T * A * u = A^T * b:
{{10, 1, -2}, {1, 7, 2}, {-2, 2, 4}} * u = {{-9}, {-13}, {6}}
- User
A={{1,1,0,},{-2,-1,2,},{-1,1,0,},{2,-2,0,}} b={{-2},{3},{-3},{2}} The system Ax=b has a unique least squares solution u = (x,y,z) a. Find x,y and z b. Compute the “least square error” ||\boldsymbol{b}-\boldsymbol{Au}||^2
- Assistant
Based on the previous calculations, we have found that the least squares solution u:
u = {{-11}, {-461/138}, {359/32}}
So, we have (x, y, z) = (-11, -461/138, 359/32)
Part a:
x = -11 y = -461/138 z = 359/32
Part b:
To compute the "least square error" ||𝐛−𝐀𝐮||², first find Au:
Au = {{1, 1, 0}, {-2, -1, 2}, {-1, 1, 0}, {2, -2, 0}} * {{-11}, {-461/138}, {359/32}}
Au = {{-11 - 461/138}, {22 + 461/138 + 2 * 359/32}, {11 - 461/138}, {-22 + 2 * 461/138}}
Au = {{475/138}, {-326/32}, {-111/138}, {898/138}}
Now compute 𝐛−𝐀𝐮:
b-Au = {{-2 - 475/138}, {3 + 326/32}, {-3 + 111/138}, {2 - 898/138}}
b-Au = {{(-753)/138}, {(97)/32}, {(267)/138}, {(-1694)/138}}
Now find the square of the differences:
Square(b-Au) = {((-753)/138)^2, ((97)/32)^2, ((267)/138)^2, ((-1694)/138)^2}
Square(b-Au) = {((753)^2)/138^2, (97^2)/32^2, ((267)^2)/138^2, ((1694)^2)/138^2}
Now sum the squared differences and take the square root to find the least square error: