Mark Yourself Question
Find the equation of the line that comes as close as possible, in the least squares sense, to passing through the points: (0,1),(2,3),(3,4),(4,7)(0,1),(2,3),(3,4),(4,7)(0,1),(2,3),(3,4),(4,7) .
Solution:
M=[10121314],y⃗=[1347],MTM=[49929],MTy⃗=[1546]M=\left[\begin{array}{rr}1&0\\1&2\\1&3\\1&4\end{array}\right],\vec y=\left[\begin{array}{r}1\\3\\4\\7\end{array}\right],M^TM=\left[\begin{array}{rr}4&9\\9&29\end{array}\right], M^T\vec y=\left[\begin{array}{rr}15\\46\end{array}\right]M=11110234,y=1347,MTM=[49929],MTy=[1546] . Row reduce the augmented matrix for the system of normal equations: [491592946]→...→[103/5017/5] ⟹ (c0,c1)=(3/5,7/5) ⟹ f(x)=(3/5)+(7/5)x\left[\begin{array}{rr|r}4&9&15\\9&29&46\end{array}\right]\rightarrow...\rightarrow \left[\begin{array}{rr|r}1&0&3/5\\0&1&7/5\end{array}\right]\implies (c_0,c_1)=(3/5,7/5)\implies f(x)=(3/5)+(7/5)x[499291546]→...→[10013/57/5]⟹(c0,c1)=(3/5,7/5)⟹f(x)=(3/5)+(7/5)x
Unlock full course notes by signing up
Quadratic equations and matrices
Find a quadratic equation (of the form ax2+bx+c=0ax^2+bx+c=0ax2+bx+c=0) that passes through the points (0,-3), (1,-1) and (2,3).
Find an interpolating polynomial of degree at most 2 of the data points (0,2)\left(0,2\right)(0,2), (1,−1)\left(1,-1\right)(1,−1), and (2,1)\left(2,1\right)(2,1).
Find an interpolating polynomial of degree at most 2 of the data points (1,2)\left(1,2\right)(1,2), (2,0)\left(2,0\right)(2,0), and (3,12)\left(3,12\right)(3,12).
Practice Question: Least Squares for Polynomials
Find the cubic polynomial which best fits the data points (−2,−1),(−1,1),(0,0),(1,−2),(2,3)(-2,-1),(-1,1),(0,0),(1,-2),(2,3)(−2,−1),(−1,1),(0,0),(1,−2),(2,3) in the least squares sense.
Polynomial of least degree
Find the interpolating polynomial of least degree for the data points (0,−3)\left(0,-3\right)(0,−3), (1,−1)\left(1,-1\right)(1,−1), and (−2,5)\left(-2,5\right)(−2,5).
Applications
Example: Polynomial Interpolation
Find an interpolating polynomial for the points A(1,1), B(2,2), C(0,−2)A(1,1),\ \ B(2,2),\ \ C(0,-2)A(1,1), B(2,2), C(0,−2).
Example: Least Squares for Linear Functions
Find the equation of the line that comes as close as possible to passing through the points: (0,1),(2,3),(3,4),(4,7)(0,1),(2,3),(3,4),(4,7)(0,1),(2,3),(3,4),(4,7).
Example: Least Squares for Polynomials
Find the equation of a quadratic polynomial that comes as close as possible to passing through the points: (1,2),(1,3),(2,3)(1,2),(1,3),(2,3)(1,2),(1,3),(2,3).
Least Squares for Mix of Quadratic and Linear Functions
Find a least squares approximation of form a+bx+cx2+dya+bx+cx^2+dya+bx+cx2+dy for the following data:
x‾y‾result‾11112−121−3222011\begin{array}{r|r|r}\underline{x}&\underline{y}&\underline{result}\\1&1&1\\1&2&-1\\2&1&-3\\2&2&2\\0&1&1\end{array}x11220y12121result1−1−321
Least Squares
Find a function of the form a0+a1x+a3x3a_0+a_1x+a_3x^3a0+a1x+a3x3 (note there is no squared term) which is a best approximation in the sense of least squares to the following data points: (0,1),(−1,1),(1,2),(−2,1)(0,1),(-1,1),(1,2),(-2,1)(0,1),(−1,1),(1,2),(−2,1) .
19.4F_133_8.2_Mock_F1_$\tkco{eg2}$_$\key{Final}$_Builder_$\tkcth{8.2.}\tkcf{2}$_
Show that, in the case that the matrix A‾\AA is invertible, the least squares solution corresponding to the system:
is the same as the solution to the system itself.
Practice: Least Squares Approximation
Find the cubic polynomial which best fits the data points (−2,−1),(−1,1),(0,0),(1,−2),(2,3)(-2,-1),(-1,1),(0,0),(1,-2),(2,3)(−2,−1),(−1,1),(0,0),(1,−2),(2,3).
Example: Least Squares for non-Polynomials
Find the function of form c1sin(x)+c2cos(x)c_1\sin(x)+c_2\cos(x)c1sin(x)+c2cos(x) which best fits the data points (−π,−3),(0,−4),(π/2,−5)(-\pi,-3),(0,-4),(\pi/2,-5)(−π,−3),(0,−4),(π/2,−5) in the least squares sense.