lecture19 - 4/20/2009 Summary of Least Squares COMPUTER...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
4/20/2009 1 COMPUTER SCIENCE 51 Spring 2009 cs51.seas.harvard.edu Prof. Greg Morrisett Prof. Ramin Zabih Summary of Least Squares 0 1 2 3 4 5 6 0 2 4 6 8 10 12 Time Mileage ( ) 2 Err( , ) i i i m b y mx b = - + Nice example graph From: http://pubs.acs.org/doi/abs/10.1021/ci700332k c/o The Atlantic via Cindy Cheng 0 100 200 300 400 500 600 14.6 14.8 15 15.2 15.4 15.6 15.8 16 Lemons imported from Mexico Total US Highway Fatality Rate Why do hillclimbing? It’s rare to have an exact solution Even for LS, some variant of hillclimbing is used in practice for big problems For non-convex functions, it’s the most sensible idea (yields local minimum) Recall: exact formula for LS But, suppose that our data did not come from a single line? Let’s pretend Suppose we knew how many lines there were, and the break locations
Background image of page 1

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

View Full DocumentRight Arrow Icon
4/20/2009 2 New error function Write break point between line 1 and line 2 as x 12 , and data as {(x i ,y i )}. Then our error function is If we know there are 2 lines and also know the break point, this is convex Just two convex subproblems 12 12 2 2 1 1 2 2 1 1 2 2 Err( , , , ) ( ( )) ( ( )) i i i i i i x x x x m b m b y m x b y m x b < > = - + + - + Find the break point? Suppose we don’t know the break? Try all, pick the best one What if there are more than 2 lines? With N data points, at most N – 1 breaks For the solution where each point has a line 12 12 1 1 2 2 12 2 2 1 1 2 2 Err( , , , , ) ( ( )) ( ( )) i i i i i i x x x x m b m b x y m x b y m x b < > = - + + - + Segmented least squares We don’t know how many lines there are, or where the breaks occur
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

lecture19 - 4/20/2009 Summary of Least Squares COMPUTER...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online