Principal Component Analysis Adapted by Paul Anderson from Tutorial by Doug Raiford.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Chapter 4 Euclidean Vector Spaces
3D Geometry for Computer Graphics
Chapter 7 Analyzing Conic Sections
Review Conic Sections C E H P. General Form of a Conic Equation We usually see conic equations written in General, or Implicit Form: where A,
Section 11.6 – Conic Sections
Graphs Chapter 1 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AAA A.
Symmetric Matrices and Quadratic Forms
Conic Sections Parabola Ellipse Hyperbola
Distance and Midpoint Formulas The distance d between the points (x 1, y 1 ) and (x 2, y 2 ) is given by the distance formula: The coordinates of the point.
INTRO TO CONIC SECTIONS. IT ALL DEPENDS ON HOW YOU SLICE IT! Start with a cone:
11.5 Translation of Axes & the General Form. So far our conic sections in general form have looked like this: Ax 2 + Cy 2 + Dx + Ey + F = 0 But there.
Identifying Conic Sections
College Algebra Fifth Edition
Copyright © Cengage Learning. All rights reserved.
Solving Equations. Is a statement that two algebraic expressions are equal. EXAMPLES 3x – 5 = 7, x 2 – x – 6 = 0, and 4x = 4 To solve a equation in x.
By: Will Puckett. For those who don’t already know… What is Calculus? Definition of CALCULUS  a : a method of computation or calculation in a special.
Algebra Review. Polynomial Manipulation Combine like terms, multiply, FOIL, factor, etc.
Eigenvectors and Eigenvalues
Copyright © Cengage Learning. All rights reserved. Conic Sections.
Elementary Linear Algebra Anton & Rorres, 9th Edition
Identifying Conic Sections
CHAPTER 9 CONIC SECTIONS.
Slide 5- 1 Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Identifying Conic Sections
Rotating Conic Sections
What is the standard form of a parabola who has a focus of ( 1,5) and a directrix of y=11.
Conics A conic section is a graph that results from the intersection of a plane and a double cone.
& & & Formulas.
Chapter 9 Conic Sections and Analytic Geometry Copyright © 2014, 2010, 2007 Pearson Education, Inc Rotation of Axes.
Conics can be formed by the intersection
SECTION: 10 – 4 ROTATIONS WARM-UP Find the center, vertices, foci, and the equations of the asymptotes of each hyperbola. 3. Write the standard form of.
Slide Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2011 Pearson, Inc. 8.4 Translation and Rotation of Axes.
Ax 2 + Bxy + Cy 2 + Dx + Ey + F=0 General Equation of a Conic Section:
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
Sullivan Algebra and Trigonometry: Section 11.5 Objectives of this Section Identify a Conic Use a Rotation of Axes to Transform Equations Discuss an Equation.
Jeopardy CirclesParabolasEllipsesHyperbolasVocabulary Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy Source:
Conic Sections By: Danielle Hayman Mrs. Guest Per. 4.
Conics: a crash course MathScience Innovation Center Betsey Davis.
Copyright © Cengage Learning. All rights reserved. 9.3 Hyperbolas and Rotation of Conics.
Section 8.3 Ellipses Parabola Hyperbola Circle Ellipse.
Rotation of Axis.
Conic Sections The Parabola. Introduction Consider a ___________ being intersected with a __________.
Use the Pythagorean theorem to find the length of the missing side. 1)a = 12,b = 9 2)a = 5,c = 13 Find the mean of the two numbers. 3)18 and 34 4)18 and.
Conics.
Concept Category #14 Conics in the Rectangular Coordinate System 6A I can derive the equations of circles, parabolas, ellipses and hyperbolas given the.
Conic Sections There are 4 types of Conics which we will investigate: 1.Circles 2.Parabolas 3.Ellipses 4.Hyperbolas.
Chapter 1.1 – Graphs of Equations What you should learn 1. Sketch graphs of equations 2. Find x- and y- intercepts of graphs of equations 3. Use symmetry.
Distance The distance between any two points P and Q is written PQ. Find PQ if P is (9, 1) and Q is (2, -1)
Conics. Conic Sections - Definition A conic section is a curve formed by intersecting cone with a plane There are four types of Conic sections.
Conic Sections. Objective Given a translation, I can graph an equation for a conic section.
Math 1314 College Algebra Final Review Solutions.
INTRO TO CONIC SECTIONS. IT ALL DEPENDS ON HOW YOU SLICE IT! Start with a cone:
Computer Graphics Lecture 07 Ellipse and Other Curves Taqdees A. Siddiqi
Chapter 10 Conic Sections
Objectives Identify and transform conic functions.
Conics A conic section is a graph that results from the intersection of a plane and a double cone.
Conics A conic section is a graph that results from the intersection of a plane and a double cone.
Analyzing Conic Sections
Warm Up circle hyperbola circle
6.2 Equations of Circles +9+4 Completing the square when a=1
Conic Sections College Algebra
Topics in Analytic Geometry
9.6A Graphing Conics Algebra II.
Review Circles: 1. Find the center and radius of the circle.
Eigen Decomposition Based on the slides by Mani Thomas
Analyzing Conic Sections
Chapter 10 Conic Sections.
Chapter 2 Determinants.
Presentation transcript:

Principal Component Analysis Adapted by Paul Anderson from Tutorial by Doug Raiford

The Problem with Apples and Oranges High dimensionality Can’t “see” If had only one, two, or three features, could represent graphically But 4 or more… WeightDiameterRednessOrangeness Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex Ex

If Could Compress Into 2 Dimensions Apples and oranges: feature vectors Axis of greatest variance

How? In MatLab – evects = princomp(allFruit); b1=evects(:,1); b2=evects(:,2); Z1=allFruit*b1; Z2=allFruit*b2; scatter(Z1,Z2);

Real World Example 59 dimensions 3500 genes Very useful in exploratory data analysis Sometimes useful as a direct tool (MCU)

But We’re Not Scared of the Details Given – Data matrix M (feature vectors for all examples) Generate – covariance matrix for M (Σ) – Eigenvectors (principal components) from covariance matrix MΣ Eigenvectors

Eigenvectors and Eigenvalues Each Eigenvector is accompanied with an Eigenvalue The Eigenvector with the greatest Eigenvalue points along the axis of greatest variance

Eigenvectors and Eigenvalues If use only first principal component very little degradation of data Have reduced dimensions from 2 to 1

Project data onto new axes Once have Eigenvectors can project data onto new axis Eigenvectors are unit vectors, so simple dot product produces the desired effect MΣ EigenvectorsProject Data

Covariance Matrix M Σ EigenvectorsProject Data 1,11,21,31,4 2,12,22,32,4 3,13,23,33,4 4,14,24,34,4

Covariance Matrix

Covariance Matrix

Eigenvector – Linear transform of the Eigenvector using Σ as the transformation matrix resulting in a parallel vector M Σ EigenvectorsProject Data

Eigenvector How to find – Σ is an nxn matrix – There will be n Eigenvectors – Eigenvectors ≠ 0 – Eigenvalues ≠ 0

Eigenvector A is invertible if and only if det(A)  0 If (A- v) is invertible then: But it is given that v  0 so must not be invertible Not invertible so det(A- v) = 0

Eigenvector First, solve for the by performing the following operations: If solve for will get 2 roots, 1 and 2.

Eigenvector Now that the Eigenvalues have been acquired we can solve for the Eigenvector (v below). Know Σ, know, know I, so becomes homogeneous system of equations (equal to 0) with the entries of v as the variables Already know that there is no unique solution – The only way there is a unique solution is if the trivial solution is only solution. – If this were the case it would be invertible

Back to the example

Eigenvectors (Summary) Find characteristic polynomial using determinant Solve for Eigenvalues (λ’s) Solve for Eigenvectors M Σ EigenvectorsProject Data P(λ) λ’s Eigenvectors

Axis of Greatest Variance? Equation for an ellipse D, E, and F have to do with translation A and C related to the ellipse’s spread along the X and Y axes, respectively B has to do with rotation

Axis of Greatest Variance Mathematicians discovered that any ellipse can be exactly captured by a symmetric matrix Covariance matrix is symmetric The Eigenvectors of the said matrix point along the principal axes of the ellipse Origin of the name (principal components analysis) AB/2 C Related to spread along x axis (variance of data along x axis) Related to spread along y axis Related to rotation (covariance)

Principal Axis Theorem Principal axis theorem holds for quadratic forms (conic sections) in higher dimensional spaces

Project Data Onto Principal Components Eigenvectors are unit vectors M Σ EigenvectorsProject Data

Review In MatLab evects = princomp(allFruit); b1=evects(:,1); b2=evects(:,2); Z1=allFruit*b1; Z2=allFruit*b2; scatter(Z1,Z2);

Practice Covariance matrix

Practice M Σ EigenvectorsProject Data P(λ) λ’s Eigenvectors 42 24

Practice M Σ EigenvectorsProject Data P(λ) λ’s Eigenvectors

Practice M Σ EigenvectorsProject Data P(λ) λ’s Eigenvectors 42 24

Questions?

Why Invertible if row reducible to I?

Implication of Zero Determinants

Why Eigenvector Associated with Greatest λ Points Along Axis of Greatest Variance

Rotation Good search terms: rotation of axes conic sections Note that in the sections above dealing with the ellipse, hyperbola, and the parabola, the algebraic equations that appeared did not contain a term of the form xy. However, in our “Algebraic View of the Conic Sections,” we stated that every conic section is of the form Ax2 + Bxy + Cy2 + Dx + Ey + F = 0 where A, B, C, D, E, and F are constants. In essence, all of the equations that we have studied have had B=0. So the question arises: “What role, if any, does the xy term play in conic sections? If it were present, how would that change the geometric figure?” First of all, the answer is NOT that the conic changes from one type to another. That is to say, if we introduce an xy term, the conic does NOT change from an ellipse to a hyperbola. If we start with the standard equation of an ellipse and insert an extra term, an xy term, we still have an ellipse. So what does the xy term do? The xy term actually rotates the graph in the plane. For example, in the case of an ellipse, the major axis is no longer parallel to the x-axis or y-axis. Rather, depending on the constant in front of the xy term, we now have the major axis rotated. Let’s look at an example. * Example

rotation A is related to elongation in x direction C is related to elongation in y direction B is related to rotation (B is not equal to zero if and only if there is rotation) D, E, and F related to h and k (x and y shift, (x-h), (y-k)) D, E, and F not affected by rotation A and C are affected

Standard equation Standard equation of the ellipse is: a = 5 and b = 2 Hence: The length of major axes is: 2a = 10. The length of minor axes is: 2b = 4.

New rotated coordinate system Coordinate Rotation Formulas – If a rectangular xy-coordinate system is rotated through an angle θ to form an x’y’ coordinate system, then a point P(x; y) will have coordinates P(x’; y’) in the new system, where (x; y) and (x’; y’) are related by x = x’ cos θ − y' sin θ and y = x' sin θ + y' cos θ : and x' = x cos θ + y sin θ and y' = −x sin θ + y cos θ :

rotation The values of h and k give horizontal and vertical (resp.) translation distances, and t gives rotation angle (measured in degrees). Notice how changes in these transformation values affect the coefficients, and how changes in the coefficients affect the transformations. The lines shown in green in the graph are the following key lines for the conic sections: the major and minor axes for ellipses (crossing at the center of the ellipse), the axis of symmetry and perpendicular line through the vertex for a parabola (crossing at the vertex), and the two perpendicular axes of symmetry (crossing through the center point) for a hyperbola. In all cases, the two lines cross at the point (h,k), and are rotated from the position parallel to the coordinate axes by t degrees. In graphs of hyperbolas, the asymptotes of the hyperbola are shown as orange lines. If B2-4AC<0, then the graph is an ellipse (if B=0 and A=C in this case, then the graph is a circle) One other important formula determines the relationship between the coefficients and the angle of rotation: tan(2t)=B/(A-C). Note that rotation has no effect on the values of the coefficients D, E, and F, and that t=0 (no rotation) if and only if B=0. The values of the coordinates of the point (h,k) are best determined from the coefficients by first reversing the effect of the rotation (so that B=0), then completing the squares.

Principal Axis Theorem Principal axis theorem holds for quadratic forms (conic sections) in higher dimensional spaces