This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Leastsquares line Polynomial leastsquares General linear models General Linear LeastSquares Dhavide Aruliah UOIT MATH 2070U c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 1 / 34 Leastsquares line Polynomial leastsquares General linear models General Linear LeastSquares 1 Leastsquares fitting with straight line (leastsquares line) 2 Leastsquares fitting with polynomials (polynomial leastsquares) 3 Leastsquares fitting of general linear models c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 2 / 34 Leastsquares line Polynomial leastsquares General linear models Data approximation problem Data approximation problem Given n data points { ( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , ( x n , y n ) } , determine a function e f that approximates the data, i.e., e f ( x k ) y k ( k = 1: n ) .54321 1 2 3 4 5321 1 2 3 c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 4 / 34 Leastsquares line Polynomial leastsquares General linear models Leastsquares fit with straight line (cont.) 1 2 3 4 5 6 7 8 9 1021 1 2 3 4 5 Least squares line fit c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 5 / 34 Leastsquares line Polynomial leastsquares General linear models Leastsquares fit with straight line Let e f ( x ) = a + a 1 x Given { ( x k , y k ) } n k = 1 , exact interpolation conditions are a + a 1 x k = y k ( k = 1: n ) Write system of equations to fit in matrix form 1 a + x 1 a 1 = y 1 1 a + x 2 a 1 = y 2 . . . 1 a + x n a 1 = y n 1 x 1 1 x 2 1 x 3 . . . . . . 1 x n  {z } [ V ] a a 1  {z } { a } = y 1 y 2 y 3 . . . y n  {z } { y } [ V ] R n 2 { a } R 2 1 { y } R n 1 Overdetermined system to approximate solution is [ V ] { a } = { y } c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 6 / 34 Leastsquares line Polynomial leastsquares General linear models Normal equations for leastsquares line From before, normal equations are n k = 1 [ a + a 1 x k y k ] = n k = 1 a x k + a 1 x 2 k y k x k = Normal equations in matrix form: [ V ] T [ V ] { a } = [ V ] T { y } In practice, leastsquares approximation found directly from [ V ] { a } = { y } c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 7 / 34 Leastsquares line Polynomial leastsquares General linear models Solution of the normal equations For overdetermined linear system of equations [ V ] { a } = { y } , normal equations [ V ] T [ V ] { a } = [ V ] T { y } solved directly using backslash in MATLAB c D. Aruliah (UOIT) General Linear LeastSquares MATH 2070U 8 / 34 Leastsquares line Polynomial leastsquares General linear models Example: biomechanical data k k e k k k e k 1 0.00 0.00 5 0.31 0.23 2 0.06 0.08 6 0.47 0.25 3 0.14 0.14 7 0.60 0.28 4 0.25 0.20 8 0.70 0.29 c.f., Problem 3.3, Figure 3.16 in Quarteroni & Saleric....
View Full
Document
 Winter '10
 aruliahdhavidhe
 Math, Least Squares

Click to edit the document details