Prof. Ramin Zabih http://cs100r.cs.cornell.edu Beyond binary search Prof. Ramin Zabih http://cs100r.cs.cornell.edu.

Slides:



Advertisements
Similar presentations
Least squares CS1114
Advertisements

1 Functions and Applications
Optimization : The min and max of a function
3.5 The Triangle Sum Theorem
Bisection Method (Midpoint Method for Equations).
INTEGRALS Areas and Distances INTEGRALS In this section, we will learn that: We get the same special type of limit in trying to find the area under.
INTEGRALS The Fundamental Theorem of Calculus INTEGRALS In this section, we will learn about: The Fundamental Theorem of Calculus and its significance.
INTEGRALS 5. INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area.  We also saw that it arises when we try to find.
FURTHER APPLICATIONS OF INTEGRATION 9. In chapter 6, we looked at some applications of integrals:  Areas  Volumes  Work  Average values.
Copyright © Cengage Learning. All rights reserved. 5 Integrals.
8 TECHNIQUES OF INTEGRATION. There are two situations in which it is impossible to find the exact value of a definite integral. TECHNIQUES OF INTEGRATION.
So are how the computer determines the size of the intercept and the slope respectively in an OLS regression The OLS equations give a nice, clear intuitive.
1/1/20001 Topic >>>> Scan Conversion CSE Computer Graphics.
When you see… A1. Find the zeros You think…. A1 To find the zeros...
Introduction to Proofs
INTEGRALS Areas and Distances INTEGRALS In this section, we will learn that: We get the same special type of limit in trying to find the area under.
Area/Sigma Notation Objective: To define area for plane regions with curvilinear boundaries. To use Sigma Notation to find areas.
INTEGRALS The Fundamental Theorem of Calculus INTEGRALS In this section, we will learn about: The Fundamental Theorem of Calculus and its significance.
INTEGRALS 5. INTEGRALS In Chapter 2, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.
Integrals  In Chapter 2, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.  In much the.
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
1 Nonlinear Equations Jyun-Ming Chen. 2 Contents Bisection False Position Newton Quasi-Newton Inverse Interpolation Method Comparison.
MIDPOINT CIRCLE & ELLIPSE GENERARTING ALGORITHMS
Clustering Prof. Ramin Zabih
Applications of Differentiation Section 4.2 The Mean Value Theorem
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
9.2 Linear Regression Key Concepts: –Residuals –Least Squares Criterion –Regression Line –Using a Regression Equation to Make Predictions.
4.1 Extreme Values of Functions
In Chapters 6 and 8, we will see how to use the integral to solve problems concerning:  Volumes  Lengths of curves  Population predictions  Cardiac.
INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area. We also saw that it arises when we try to find the distance traveled.
5 INTEGRALS.
Advanced Computer Graphics Optimization Part 2 Spring 2002 Professor Brogan.
If f (x) is continuous over [ a, b ] and differentiable in (a,b), then at some point, c, between a and b : Mean Value Theorem for Derivatives.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Area/Sigma Notation Objective: To define area for plane regions with curvilinear boundaries. To use Sigma Notation to find areas.
Copyright © Cengage Learning. All rights reserved. 4 Integrals.
INTEGRALS 5. INTEGRALS In Chapter 3, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.
Copyright © Cengage Learning. All rights reserved.
Estimating standard error using bootstrap
The simple linear regression model and parameter estimation
Department of Mathematics
Copyright © Cengage Learning. All rights reserved.
Lightstick orientation; line fitting
1 Functions and Applications
Announcements Topics: Work On:
Functions and Their Graphs
Lesson 4-QR Quiz 1 Review.
Garbage collection; lightstick orientation
Haim Kaplan and Uri Zwick
Distance y x C D A B Lengths parallel to the axes are calculated as if it was a number line. Lengths are always positive. Examples 1) Calculate the length.
1-6 Midpoint & Distance in the Coordinate Plane
Coefficient of Determination and Standard Error of the Estimate.
13 Functions of Several Variables
Prof. Ramin Zabih Least squares fitting Prof. Ramin Zabih
Regression Models - Introduction
Preprocessing to accelerate 1-NN
Important Values for Continuous functions
5 INTEGRALS.
Modeling a Linear Relationship
Greedy clustering methods
Sorting, selecting and complexity
Computational Geometry
Chapter 7 Functions of Several Variables
The First Derivative Test
Quicksort and selection
Getting to the bottom, fast
Modeling a Linear Relationship
Concavity & the 2nd Derivative Test
Regression Models - Introduction
Presentation transcript:

Prof. Ramin Zabih http://cs100r.cs.cornell.edu Beyond binary search Prof. Ramin Zabih http://cs100r.cs.cornell.edu

Administrivia Assignment 4 is due tomorrow Prelim schedule P2: Thursday Nov 1 Or possibly Tuesday Nov 6 P3: Thursday Nov 29

Beyond binary search Can we find the minimum of a 1D convex function without evaluating derivatives? We’ll use a similar interval-shrinking method Intervals will be slightly more complex Basic idea: Current interval is [a, b] Assume this is valid (minimum lies inside) We know the values of f(a) and f(b) Compute f(c) and f(d), where c and d lie inside the interval [a,b] Create a smaller interval

Key insight We will take advantage of this fact: Suppose: [A] x1 < x2 < x3 [B] f(x1) > f(x2) > f(x3) [C] f is convex Then the minimum of f does not lie between x1 and x2 Can you prove this? x1 x2 x3

Creating a smaller interval d b Initially we know f(a), f(b), f(c), f(d) Our 2nd interval will either be [a,d] or [c,b] But it will contain a point whose value we already know! Either c or d

What should the spacing be? Either our 2nd interval is [a,d] which has c inside, or it’s [c,b] and has d inside In either case, we want to include this as part of the 3rd interval To avoid doing an extra function evaluation If we want to keep the spacing of the points consistent between iterations, the relative distances involve the golden ratio Algorithm is called golden section search

Another issue with LS fitting LS line fitting has an odd property, which is always a clue that something is wrong It’s not actually symmetric! If you interchange x and y, you get a different answer Though it’s usually close, in practice This shows up in the terminology Dependent versus independent variables The high school notion of least squares doesn’t usually mention this fact

More about lying robots We assume that the robot tells the truth about the time, but lies about its position What if the robot lies equally about both? This is actually quite realistic Getting clocks synchronized precisely among different computers turns out to be hard Let’s suppose that there are errors both in the time and in the position Sometimes called “errors-in-variables” Usually called: total least squares (Golub and van Loan, 1980)

LS residual versus TLS residual

TLS line fitting We seek the line of best fit, where the error is the sum of the squared residuals The old residuals had a simple formula “Vertical” distance from the point (x,y) to the line y=mx+b is y-(mx+b) Now we need to know: what is the distance from the point (x,y) to the line y=mx+b Not the vertical distance! Distance to the closest point, instead.

Distance from point to line

Shortest distance is perpendicular

What do we know? We know the vertical distance It’s the regular LS residual

What else do we know? The slope of the line!

How does this help? We now know 2 sides of a right triangle Time to invoke Pythagoras!