The geometry of least squares

Similar documents
Lecture 2: Vector-Vector Operations

On-Line Geometric Modeling Notes VECTOR SPACES

Vector Basics, with Exercises

Math Linear Algebra

General Physics I, Spring Vectors

Vector Geometry. Chapter 5

4.1 Distance and Length

Solutions to Review Problems for Chapter 6 ( ), 7.1

Chapter 6: Orthogonality

Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems

MTH 2310, FALL Introduction

1 Last time: row reduction to (reduced) echelon form

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra 1/33

Introduction to Matrix Algebra

v = v 1 2 +v 2 2. Two successive applications of this idea give the length of the vector v R 3 :

22m:033 Notes: 6.1 Inner Product, Length and Orthogonality

Dot Products. K. Behrend. April 3, Abstract A short review of some basic facts on the dot product. Projections. The spectral theorem.

Dot product. The dot product is an inner product on a coordinate vector space (Definition 1, Theorem

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra /34

Distance in the Plane

Solutions to Math 51 First Exam October 13, 2015

Math 3191 Applied Linear Algebra

Vector Algebra August 2013

Vectors and the Geometry of Space

Linear Algebra. 1.1 Introduction to vectors 1.2 Lengths and dot products. January 28th, 2013 Math 301. Monday, January 28, 13

Quantities which have only magnitude are called scalars. Quantities which have magnitude and direction are called vectors.

1 Last time: multiplying vectors matrices

Chapter 6. Orthogonality and Least Squares

11.1 Vectors in the plane

Section 6.1. Inner Product, Length, and Orthogonality

Vectors. Advanced Math Circle. October 18, 2018

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note 21

Problem 1: (3 points) Recall that the dot product of two vectors in R 3 is

Orthogonality and Least Squares

Review of Coordinate Systems

Math 2331 Linear Algebra

GEOMETRY OF MATRICES x 1

MATH 12 CLASS 2 NOTES, SEP Contents. 2. Dot product: determining the angle between two vectors 2

The Geometry of R n. Supplemental Lecture Notes for Linear Algebra Courses at Georgia Tech

Review: Linear and Vector Algebra

Inner Product, Length, and Orthogonality

Chapter 3 Kinematics in Two Dimensions; Vectors

This pre-publication material is for review purposes only. Any typographical or technical errors will be corrected prior to publication.

22m:033 Notes: 1.3 Vector Equations

Sums of Squares (FNS 195-S) Fall 2014

Fourier and Wavelet Signal Processing

1 Notes for lectures during the week of the strike Part 2 (10/25)

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

Vector components and motion

Lecture 7. Econ August 18

LINEAR ALGEBRA KNOWLEDGE SURVEY

Lecture 3: Linear Algebra Review, Part II

Day 1: Introduction to Vectors + Vector Arithmetic

Vectors for Beginners

Mathematical Foundations: Intro

Practical Linear Algebra: A Geometry Toolbox

Introduction to Vectors

NOTES ON LINEAR ALGEBRA CLASS HANDOUT

Linear Models Review

LINEAR ALGEBRA - CHAPTER 1: VECTORS

Welcome to IB Math - Standard Level Year 2

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Ch. 7.3, 7.4: Vectors and Complex Numbers

MASTER OF SCIENCE IN ANALYTICS 2014 EMPLOYMENT REPORT

Vectors and Matrices

Course Notes Math 275 Boise State University. Shari Ultman

10.1 Vectors. c Kun Wang. Math 150, Fall 2017

Maple Output Maple Plot 2D Math 2D Output

(arrows denote positive direction)

Welcome to IB Math - Standard Level Year 2.

Omm Al-Qura University Dr. Abdulsalam Ai LECTURE OUTLINE CHAPTER 3. Vectors in Physics

SECTION 6.3: VECTORS IN THE PLANE

REVIEW - Vectors. Vectors. Vector Algebra. Multiplication by a scalar

CS 143 Linear Algebra Review

UNIT-05 VECTORS. 3. Utilize the characteristics of two or more vectors that are concurrent, or collinear, or coplanar.

Span and Linear Independence

An overview of key ideas

Matrix Algebra: Vectors

Math 24 Spring 2012 Questions (mostly) from the Textbook

(1) Recap of Differential Calculus and Integral Calculus (2) Preview of Calculus in three dimensional space (3) Tools for Calculus 3

Kinematics in Two Dimensions; Vectors

We know how to identify the location of a point by means of coordinates: (x, y) for a point in R 2, or (x, y,z) for a point in R 3.

A Geometric Review of Linear Algebra

6.1. Inner Product, Length and Orthogonality

Final Examination 201-NYC-05 - Linear Algebra I December 8 th, and b = 4. Find the value(s) of a for which the equation Ax = b

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Friday, 2 November 12. Vectors

Chapter 13: Vectors and the Geometry of Space

Chapter 13: Vectors and the Geometry of Space

Orthogonality. Orthonormal Bases, Orthogonal Matrices. Orthogonality

Chapter 8 Vectors and Scalars

Linear Equations and Vectors

The 'linear algebra way' of talking about "angle" and "similarity" between two vectors is called "inner product". We'll define this next.

Fact: Every matrix transformation is a linear transformation, and vice versa.

The Geometry of Linear Regression

Vectors. In kinematics, the simplest concept is position, so let s begin with a position vector shown below:

2- Scalars and Vectors

Contents. 1 Vectors, Lines and Planes 1. 2 Gaussian Elimination Matrices Vector Spaces and Subspaces 124

Quiz No. 1: Tuesday Jan. 31. Assignment No. 2, due Thursday Feb 2: Problems 8.4, 8.13, 3.10, 3.28 Conceptual questions: 8.1, 3.6, 3.12, 3.

Transcription:

The geometry of least squares We can think of a vector as a point in space, where the elements of the vector are the coordinates of the point. Consider for example, the following vector s: t = ( 4, 0), u = (5, 0), v = (4, 4), w = ( 2, 2) Each of these vectors has two elements. If we regard, for example, the first element of the vector v as the x-coordinate and the second element of v as the y-coordinate, each vector can be represented by a point in a two-dimensional space as shown in the picture below. This idea can be extended to factors with three or more elements, but we need a space of three or more dimensions to do so. Our inability to visualize a multidimensional space, however, should not prevent us from thinking of any n-element vector as a point in an n-dimensional space A vector can also be viewed geometric way as they directed line segment with an arrow starting from the origin and ending at the point representing the vector in the space. Draw this geometric representation in the plot below. 1

Again, this way of viewing vectors can be extended to vectors with three or more elements, as we can always imagine a line segment starting at the origin of an n-dimensional space and ending at the point representing the vector in the space. This geometric representation of vectors raises 2 questions: What are the length and direction of the line segment representing a vector? What is the angle between two line segments representing two vectors? We now have three ways of viewing a vector: algebraically, graphically, and geometrically. Let s measure the length of the line segment representing the vector v. Using Pythagorean theorem, the length of the vector v, that is, the line from the origin to the point v in the figure above is: You can verify that the lengths of the vectors w and t are 2 2 and 4, respectively. More generally, for any n-dimensional vector v = (v 1, v 2,..., v n ), the length of v, denoted by v is defined as v = v v = The length the vector is also referred to as the norm of the vector. Note that the length of the geometric vector can be interpreted as the magnitude of the corresponding algebraic vector. Thus the larger the elements of the vector in absolute value, the greater its length and the larger the magnitude of the vector. Now let s measure the angle between any to geometric vectors. Consider the angle between the two vectors in the diagram below. 2

The numerator is the inner product of the two vectors. Thus, the cosine of the angle between two vectors is the ratio of their inner product and the product of their lengths (norms). For example, let s measure the angle between the vectors u and v from above. u v = 5 4 + 0 4 = 20 u = 5 v = 4 2 And hence cos(θ) = u v u v = 1 2 The angle between two vectors is directly related to the concepts of linear dependence and independence. Two vectors u and v are linearly dependent if and only if one vector can be written as the scalar multiple of the other. When this happens, the cosine of the angle between these two vectors is either +1 or -1. This implies that the angle is either 0 or 180 degrees. We may then conclude that went to vectors are linearly dependent, the angle between them is either 0 or 180 degrees, which means that the two line segments representing the vectors have the same (or opposite) direction. The converse of the statement is also true. Two vectors u and v of the same order are perpendicular if and only if u v = 0. We also say that these two vectors are orthogonal. The converse is also true, that is, when two vectors have an inner product of 0 then they are orthogonal. However if two vectors are linearly independent they may or may not be orthogonal. Now take a look at what happens graphically only after subtract two vectors, or when we multiply vector by a scalar. Suppose you wish to add the vectors v. and w. Algebraically, we have Draw the geomtric picture below. Notice that the line segment representing the sum of the two vectors is the diagonal of the parallelogram having the line segments representing the two vectors 3

as adjacent to edges. This is known as the parallelogram rule, and is always true for the sum of any two vectors. What about the difference between two vectors? The distance between the vectors v. and w is the same as the norm (length) of the vector (v-w). It is sometimes useful to consider the difference between two vectors v and w as the sum of v and -w. Multiplying a vector by a scalar amounts to multiplying each of its elements by the scalar. Draw a picture to convince yourself of this. 4

A vector of length one is called a normal vector. Any non-zero vector can be normalized by dividing each of its elements by its norm. This transformation is called normalization. The normalized versions of two vectors of the same direction are equal. The elements of the normal vector can be interpreted as direction cosines. Simply stated, they are the cosine of the angles between the vector and each of the coordinate axes. Draw a picture to convince yourself of this. Connection to Fitting by Least Squares Consider observations (x 1, y 1 ),..., (x n, y n ). Reexpress these observations as two n-dimensional vectors, y = (y 1,..., y n ) and x = (x 1,..., x n ). Let 1 denote the vector in n-dimensional space of all 1 s, i.e. 1 = (1, 1,..., 1). The span of x is all those vectors of the form cx, where c is a scalar. collection of vectors that can be expressed as ax + b1. The span of x, 1 is the Show the following 1. n i=1 (y i c) 2 = 2 2. So minimizing the quantity above with respect to c is the same as finding the in the linear span of 3. Show that 1 is orthogonal to y ȳ1. Use a picture to verify this fact. 4. Use this fact to show that y c1 2 = y ȳ1 2 + (ȳ c)1 2 5

5. Next establish that ȳ is the minimizer of n i=1 (y i c) 2, and that ȳ1 is the closest point in the linear span of 1 to y. 6. Show that in general the closest vector to y in the linear span of a vector v is the projection P v y = y v v 2 v 7. Now consider the lest squares fit from this geometric perspective n [y i (a + bx i )] 2 = 2 i=1 Minimizing with respect to a and b is equivalent to projecting onto the linear span of and, of finding the closest vector to in the linear span of 8. Show that the linear span of 1 and x is the same as the linear span of 1 and x x1. 9. Explain why P 1,x y = P 1 y + P x x1 y. 10. Show that P 1 y = ȳ1 and P x x1 y = y (x x1) (x x1) x x1 2 6

11. Show that ˆb obtained from minimizing n i=1 [y i (a + bx i )] 2 y (x x1) x x1 2 12. Reexpress â as well. 13. We now see that ŷ is the projection of onto the linear span of. We also see that the residuals e are to ŷ, i.e. e = y P 1,x y. 7