Lecture_16_regression_F07

Lecture_16_regression_F07 - 1 E7 INTRODUCTION TO COMPUTER...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
E7 L15 1 E7: INTRODUCTION TO COMPUTER E7: INTRODUCTION TO COMPUTER PROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND ENGINEERS ENGINEERS Lecture Outline 1. Least squares solution when n = # equations >> m = # of unknowns 1. Regression and curve fit Copyright 2007, Horowitz, Packard. This work is licensed under the Creative Commons Attribution-Share Alike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
E7 L15 2 Linear equations in matrix form Linear equations in matrix form Consider n LINEAR equations and m unknowns. A   matrix ( n x m ) p   vector ( m x 1) y   vector ( n x 1) unknown
Image of page 2
E7 L15 3 Linear equations in matrix form Linear equations in matrix form = n-by- m m -by-1 n-by-1 = n-by- m m -by-1 n-by-1 A p y A p y
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
E7 L15 4 Linear equations in matrix form when Linear equations in matrix form when n n >> >> m m = n-by- m m -by-1 n-by-1 A p y n n : number of equations is much larger than m m : number of unknowns
Image of page 4
E7 L15 5 The backslash operator: The backslash operator: p = A\y Given a set of n linear equations with m unknowns   Computes p that solves : >> p = A\y solves the least squares problem.
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
E7 L15 6 The backslash operator: The backslash operator: p = A\y What happens if the least squares (LS) solution is not unique and n n         m m ? >> p = A\y computes a basic LS solution, which has at most r nonzero components (When n n >> >> m m , this is normally not the case…) # of columns of A # of LI columns of A when r r  <   <  m m
Image of page 6
E7 L15 7 -8 -6 -4 -2 0 2 4 6 8 10 -6 -5 -4 -3 -2 -1 0 1 2 Find the linear function: that minimizes the sum of error squares: Linear Regression: Curve-fitting with minimum error Linear Regression: Curve-fitting with minimum error Given n  (x,y) data pairs: (x 1 ,y 1 ), (x 2 ,y 2 ), … ,  (x n ,y n ) y x
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
E7 L15 8 Linear Regression: Computing the LS solution Linear Regression: Computing the LS solution Given n  (x,y) data pairs: (x 1 ,y 1 ), (x 2 ,y 2 ), … ,  (x n ,y n ), For a given set of parameters: p 1 and p 2   , we can compute the errors e i ’s  as follows
Image of page 8
E7 L15 9 Linear Regression: Computing the LS solution Linear Regression: Computing the LS solution Given n  (x,y) data pairs: (x 1 ,y 1 ), (x 2 ,y 2 ), … ,  (x n ,y n ), In vector/matrix form: p   vector ( 2 x 1) A   matrix ( n x 2 ) y   vector ( n x 1) e   vector ( n x 1)
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern