21.04.2015 Views

Multivariate Calculus - Bruce E. Shapiro

Multivariate Calculus - Bruce E. Shapiro

Multivariate Calculus - Bruce E. Shapiro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

110 LECTURE 14. UNCONSTRAINED OPTIMIZATION<br />

Least Squares Linear Regression<br />

Suppose we have a large set of data points in the xy-plane<br />

{(x i , y i ) : i = 1, 2, ..., n}<br />

and we want to find the “best fit” straight line to our data, namely, we want to find<br />

number m and b such that<br />

y = mx + b<br />

is the “best” possible line in the sense that it minimizes the total sum-squared<br />

vertical distance between the data points and the line.<br />

Figure 14.3: The least squares procedure finds the line that minimizes the total sum<br />

of all the vertical distances as shown between the line and the data points.<br />

The vertical distance between any point (x i , y i ) and the line, which we will denote<br />

by d i , is<br />

d i = |mx i + b − y i |<br />

Since this distance is also minimized when its square is minimized, we instead calculate<br />

d 2 i = (mx i + b − y i ) 2<br />

The total of all these square-distances (the “sum-squared-distance”) is<br />

f(m, b) =<br />

n∑<br />

d 2 i =<br />

i=1<br />

n∑<br />

(mx i + b − y i ) 2<br />

i=1<br />

The only unknowns in this expression are the slope m and y-intercept b. Thus we<br />

have written the expression as a function f(m, b). Our goal is to find the values of<br />

m and b that correspond to the global minimum of f(m, b).<br />

Revised December 6, 2006. Math 250, Fall 2006

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!