The Projection Matrix

Total Page:16

File Type:pdf, Size:1020Kb

The Projection Matrix The Projection Matrix David Arnold Fall 1996 Abstract In this activity you will use Matlab to project a set of vectors onto a single vector. Prerequisites. Inner product (dot product) and orthogonal vectors. 1 The Inner Product We begin with the de nition of the inner product. De nition 1 Let K and L be vectors from 4n. The inner product (dot prod- uct) of vectors K and L is de ned by K ¢ L = KT L · ¸ · ¸ 1 ¡4 Example 2 If K = and L = , then 7 2 T K ¢ L = K L · ¸ £ ¤ ¡4 = 17 2 =10 Check this result in Matlab. >> u=[1;7] u= 1 7 >> v=[-4;2] v= -4 1 2 >> u*v ans = 10 If K, L and M are vectors from 4n and c is any real number, then it is not di¢cult to show that each of the following properties are true: ² K ¢ L = L ¢ K ² K ¢ (L + M) = K ¢ L + K ¢ M ² (cK) ¢ L = K ¢ (cL) = c(K ¢ L) ² K ¢ K ¸ 0 and K ¢ K =0if and only if K = . Finally, orthogonal (perpendicular) vectors are de ned as follows. De nition 3 Let K and L be vectors from 4n. Vectors K and L are orthogonal if and only if K ¢ L =0. 1.1 The Projection of One Vector Onto Another Figure 1 shows the projection of vector K onto vector L. u projLu v Figure 1. The projection of K onto L. In Figure 2, it is clear that the projection of K onto L is some scalar multiple of L; that is, projLK = cL. 2 u u-cv cv v Figure 2. The vector K ¡ cL is orthogonal to L. Note that the di¤erence vector K ¡ cL is orthogonal (perpendicular) to L. Consequently, L ¢ (K ¡ cL) =0 and we can use the previously mentioned properties to arrive at the following result: L ¢ K ¡ L¢(cL) =0 L ¢ K ¡ c(L ¢ L) =0 c(L ¢ L) = L ¢ K L ¢ K c = (1) L ¢ L Finally, substitute result (1) into projLK = cL. L ¢ K proj K = L (2) L L ¢ L · ¸ 1 Example 4 Use formula (2) to nd the projection of K = onto L = 7 · ¸ ¡4 : 2 L ¢ K projLK = L L·¢ L ¸ · ¸ ¡4 1 ¢ · ¸ 2 7 ¡4 = · ¸ · ¸ ¡4 ¡4 2 ¢ 2 2 · ¸ 10 ¡4 = 20 2 · ¸ ¡2 = 1 Check this result in Matlab. 3 >> (v*u)/(v*v)*v ans = -2 1 1.2 The Projection Matrix Lets rework formula (2). First, when you multiply a vector by a scalar, it doesnt matter whether you position the scalar before or after the vector. L ¢ K proj K = L L L ¢ L L ¢ K = L L ¢ L Next, use the transpose de nition of the inner product followed by the associa- tive property of multiplication. Remember, when performing the dot product, a scalar multiplier may be placed anywhere you wish. 1 proj K = L(LT K) L LT L 1 = (LLT )K LT L LLT = K LT L The expression LLT is called an outer product (the transpose operator is outside the product versus its inside position in the inner product). If we de ne LLT P = , then the projection formula becomes LT L LLT proj K = PK, where P = : L LT L The matrix P is called the projection matrix. You can project any vector onto the vector L by multiplying by the matrix P . · ¸ · ¸ 1 ¡4 Example 5 Let K = onto L = and nd P, the matrix that will 7 2 project any matrix onto the vector L. Use the result to nd projLK. First, nd the projection matrix. LLT P = LT L · ¸· ¸ ¡4 ¡4 T 2 2 = · ¸ · ¸ ¡4 T ¡4 2 2 4 · ¸ ¡4 £ ¤ ¡42 2 = · ¸ £ ¤ ¡4 ¡42 2 · ¸ 16 ¡8 ¡84 = · 20 ¸ : 8 ¡: 4 = ¡: 4 : 2 Check this result in Matlab. >> P=(v*v)/(v*v) P= 0.8000 -0.4000 -0.4000 0.2000 Use this result to nd the projection of K onto L. proj K = PK L · ¸· ¸ : 8 ¡: 4 1 = ¡: 4 : 2 7 · ¸ ¡2 = 1 Check this last result in Matlab. >> P*u ans = -2 1 Note that this is identical to the result in Example 4. 1.3 Projecting a Lot of Vectors onto a Single Vector First, use Matlab to generate 100 random vectors and plot them. The following commands will produce an image similar to that in Figure 3. >> U=8*rand(2,100)-4; >> x=U(1,:); >> y=U(2,:); >> plot(x,y,o) 5 4 2 0 -2 -4 -4 -2 0 2 4 Figure 3. The image in Figure 3 bears some explanation. Each circle in Figure 3 represents the tip of a vector whose tail begins at the origin. Next, use the projection matrix P to project each of the 100 2 £1 vectors in matrix U onto the vector L, then plot the results on the graph in the color red. >> PU=P*U; >> x=PU(1,:); >> y=PU(2,:); >> hold on >> plot(x,y,ro) 4 2 0 -2 -4 -4 -2 0 2 4 Figure 4. In Figuure 4, note that each vector· in¸ the matrix U is projected onto a line ¡4 in the direction of the vector L = . 2 2 Homework 1. Create 100 random 2 £ 1 vectors in a matrix U with components between ¡2 and 2. Plot them. 6 (a) Create a matrix P which will· project¸ each of the 2 £ 1 vectors in 1 matrix U onto the vector L = . 1 (b) Use the matrix P to project each 2 £ 1 vector in matrix U onto the vector L. Plot the results in a second color. (c) Obtain a printout of your result. 2. The column space of the projection matrix P is a line in the direction of the vector L. (a) What is the dimension of the column space of P ? Check your answer with the ATLAST distributions colbasis command. (b) What is the rank of P ? Check your answer with Matlabs rank command. 3. If matrix P projects all vectors onto the vector L, what should the matrix PP do? Can you explain geometrically why the matrices PP and P are equal? Check this in Matlab. 7.
Recommended publications
  • 21. Orthonormal Bases
    21. Orthonormal Bases The canonical/standard basis 011 001 001 B C B C B C B0C B1C B0C e1 = B.C ; e2 = B.C ; : : : ; en = B.C B.C B.C B.C @.A @.A @.A 0 0 1 has many useful properties. • Each of the standard basis vectors has unit length: q p T jjeijj = ei ei = ei ei = 1: • The standard basis vectors are orthogonal (in other words, at right angles or perpendicular). T ei ej = ei ej = 0 when i 6= j This is summarized by ( 1 i = j eT e = δ = ; i j ij 0 i 6= j where δij is the Kronecker delta. Notice that the Kronecker delta gives the entries of the identity matrix. Given column vectors v and w, we have seen that the dot product v w is the same as the matrix multiplication vT w. This is the inner product on n T R . We can also form the outer product vw , which gives a square matrix. 1 The outer product on the standard basis vectors is interesting. Set T Π1 = e1e1 011 B C B0C = B.C 1 0 ::: 0 B.C @.A 0 01 0 ::: 01 B C B0 0 ::: 0C = B. .C B. .C @. .A 0 0 ::: 0 . T Πn = enen 001 B C B0C = B.C 0 0 ::: 1 B.C @.A 1 00 0 ::: 01 B C B0 0 ::: 0C = B. .C B. .C @. .A 0 0 ::: 1 In short, Πi is the diagonal square matrix with a 1 in the ith diagonal position and zeros everywhere else.
    [Show full text]
  • What's in a Name? the Matrix As an Introduction to Mathematics
    St. John Fisher College Fisher Digital Publications Mathematical and Computing Sciences Faculty/Staff Publications Mathematical and Computing Sciences 9-2008 What's in a Name? The Matrix as an Introduction to Mathematics Kris H. Green St. John Fisher College, [email protected] Follow this and additional works at: https://fisherpub.sjfc.edu/math_facpub Part of the Mathematics Commons How has open access to Fisher Digital Publications benefited ou?y Publication Information Green, Kris H. (2008). "What's in a Name? The Matrix as an Introduction to Mathematics." Math Horizons 16.1, 18-21. Please note that the Publication Information provides general citation information and may not be appropriate for your discipline. To receive help in creating a citation based on your discipline, please visit http://libguides.sjfc.edu/citations. This document is posted at https://fisherpub.sjfc.edu/math_facpub/12 and is brought to you for free and open access by Fisher Digital Publications at St. John Fisher College. For more information, please contact [email protected]. What's in a Name? The Matrix as an Introduction to Mathematics Abstract In lieu of an abstract, here is the article's first paragraph: In my classes on the nature of scientific thought, I have often used the movie The Matrix to illustrate the nature of evidence and how it shapes the reality we perceive (or think we perceive). As a mathematician, I usually field questions elatedr to the movie whenever the subject of linear algebra arises, since this field is the study of matrices and their properties. So it is natural to ask, why does the movie title reference a mathematical object? Disciplines Mathematics Comments Article copyright 2008 by Math Horizons.
    [Show full text]
  • Multivector Differentiation and Linear Algebra 0.5Cm 17Th Santaló
    Multivector differentiation and Linear Algebra 17th Santalo´ Summer School 2016, Santander Joan Lasenby Signal Processing Group, Engineering Department, Cambridge, UK and Trinity College Cambridge [email protected], www-sigproc.eng.cam.ac.uk/ s jl 23 August 2016 1 / 78 Examples of differentiation wrt multivectors. Linear Algebra: matrices and tensors as linear functions mapping between elements of the algebra. Functional Differentiation: very briefly... Summary Overview The Multivector Derivative. 2 / 78 Linear Algebra: matrices and tensors as linear functions mapping between elements of the algebra. Functional Differentiation: very briefly... Summary Overview The Multivector Derivative. Examples of differentiation wrt multivectors. 3 / 78 Functional Differentiation: very briefly... Summary Overview The Multivector Derivative. Examples of differentiation wrt multivectors. Linear Algebra: matrices and tensors as linear functions mapping between elements of the algebra. 4 / 78 Summary Overview The Multivector Derivative. Examples of differentiation wrt multivectors. Linear Algebra: matrices and tensors as linear functions mapping between elements of the algebra. Functional Differentiation: very briefly... 5 / 78 Overview The Multivector Derivative. Examples of differentiation wrt multivectors. Linear Algebra: matrices and tensors as linear functions mapping between elements of the algebra. Functional Differentiation: very briefly... Summary 6 / 78 We now want to generalise this idea to enable us to find the derivative of F(X), in the A ‘direction’ – where X is a general mixed grade multivector (so F(X) is a general multivector valued function of X). Let us use ∗ to denote taking the scalar part, ie P ∗ Q ≡ hPQi. Then, provided A has same grades as X, it makes sense to define: F(X + tA) − F(X) A ∗ ¶XF(X) = lim t!0 t The Multivector Derivative Recall our definition of the directional derivative in the a direction F(x + ea) − F(x) a·r F(x) = lim e!0 e 7 / 78 Let us use ∗ to denote taking the scalar part, ie P ∗ Q ≡ hPQi.
    [Show full text]
  • Exercise 1 Advanced Sdps Matrices and Vectors
    Exercise 1 Advanced SDPs Matrices and vectors: All these are very important facts that we will use repeatedly, and should be internalized. • Inner product and outer products. Let u = (u1; : : : ; un) and v = (v1; : : : ; vn) be vectors in n T Pn R . Then u v = hu; vi = i=1 uivi is the inner product of u and v. T The outer product uv is an n × n rank 1 matrix B with entries Bij = uivj. The matrix B is a very useful operator. Suppose v is a unit vector. Then, B sends v to u i.e. Bv = uvT v = u, but Bw = 0 for all w 2 v?. m×n n×p • Matrix Product. For any two matrices A 2 R and B 2 R , the standard matrix Pn product C = AB is the m × p matrix with entries cij = k=1 aikbkj. Here are two very useful ways to view this. T Inner products: Let ri be the i-th row of A, or equivalently the i-th column of A , the T transpose of A. Let bj denote the j-th column of B. Then cij = ri cj is the dot product of i-column of AT and j-th column of B. Sums of outer products: C can also be expressed as outer products of columns of A and rows of B. Pn T Exercise: Show that C = k=1 akbk where ak is the k-th column of A and bk is the k-th row of B (or equivalently the k-column of BT ).
    [Show full text]
  • Handout 9 More Matrix Properties; the Transpose
    Handout 9 More matrix properties; the transpose Square matrix properties These properties only apply to a square matrix, i.e. n £ n. ² The leading diagonal is the diagonal line consisting of the entries a11, a22, a33, . ann. ² A diagonal matrix has zeros everywhere except the leading diagonal. ² The identity matrix I has zeros o® the leading diagonal, and 1 for each entry on the diagonal. It is a special case of a diagonal matrix, and A I = I A = A for any n £ n matrix A. ² An upper triangular matrix has all its non-zero entries on or above the leading diagonal. ² A lower triangular matrix has all its non-zero entries on or below the leading diagonal. ² A symmetric matrix has the same entries below and above the diagonal: aij = aji for any values of i and j between 1 and n. ² An antisymmetric or skew-symmetric matrix has the opposite entries below and above the diagonal: aij = ¡aji for any values of i and j between 1 and n. This automatically means the digaonal entries must all be zero. Transpose To transpose a matrix, we reect it across the line given by the leading diagonal a11, a22 etc. In general the result is a di®erent shape to the original matrix: a11 a21 a11 a12 a13 > > A = A = 0 a12 a22 1 [A ]ij = A : µ a21 a22 a23 ¶ ji a13 a23 @ A > ² If A is m £ n then A is n £ m. > ² The transpose of a symmetric matrix is itself: A = A (recalling that only square matrices can be symmetric).
    [Show full text]
  • Geometric-Algebra Adaptive Filters Wilder B
    1 Geometric-Algebra Adaptive Filters Wilder B. Lopes∗, Member, IEEE, Cassio G. Lopesy, Senior Member, IEEE Abstract—This paper presents a new class of adaptive filters, namely Geometric-Algebra Adaptive Filters (GAAFs). They are Faces generated by formulating the underlying minimization problem (a deterministic cost function) from the perspective of Geometric Algebra (GA), a comprehensive mathematical language well- Edges suited for the description of geometric transformations. Also, (directed lines) differently from standard adaptive-filtering theory, Geometric Calculus (the extension of GA to differential calculus) allows Fig. 1. A polyhedron (3-dimensional polytope) can be completely described for applying the same derivation techniques regardless of the by the geometric multiplication of its edges (oriented lines, vectors), which type (subalgebra) of the data, i.e., real, complex numbers, generate the faces and hypersurfaces (in the case of a general n-dimensional quaternions, etc. Relying on those characteristics (among others), polytope). a deterministic quadratic cost function is posed, from which the GAAFs are devised, providing a generalization of regular adaptive filters to subalgebras of GA. From the obtained update rule, it is shown how to recover the following least-mean squares perform calculus with hypercomplex quantities, i.e., elements (LMS) adaptive filter variants: real-entries LMS, complex LMS, that generalize complex numbers for higher dimensions [2]– and quaternions LMS. Mean-square analysis and simulations in [10]. a system identification scenario are provided, showing very good agreement for different levels of measurement noise. GA-based AFs were first introduced in [11], [12], where they were successfully employed to estimate the geometric Index Terms—Adaptive filtering, geometric algebra, quater- transformation (rotation and translation) that aligns a pair of nions.
    [Show full text]
  • Determinants Math 122 Calculus III D Joyce, Fall 2012
    Determinants Math 122 Calculus III D Joyce, Fall 2012 What they are. A determinant is a value associated to a square array of numbers, that square array being called a square matrix. For example, here are determinants of a general 2 × 2 matrix and a general 3 × 3 matrix. a b = ad − bc: c d a b c d e f = aei + bfg + cdh − ceg − afh − bdi: g h i The determinant of a matrix A is usually denoted jAj or det (A). You can think of the rows of the determinant as being vectors. For the 3×3 matrix above, the vectors are u = (a; b; c), v = (d; e; f), and w = (g; h; i). Then the determinant is a value associated to n vectors in Rn. There's a general definition for n×n determinants. It's a particular signed sum of products of n entries in the matrix where each product is of one entry in each row and column. The two ways you can choose one entry in each row and column of the 2 × 2 matrix give you the two products ad and bc. There are six ways of chosing one entry in each row and column in a 3 × 3 matrix, and generally, there are n! ways in an n × n matrix. Thus, the determinant of a 4 × 4 matrix is the signed sum of 24, which is 4!, terms. In this general definition, half the terms are taken positively and half negatively. In class, we briefly saw how the signs are determined by permutations.
    [Show full text]
  • Matrices and Tensors
    APPENDIX MATRICES AND TENSORS A.1. INTRODUCTION AND RATIONALE The purpose of this appendix is to present the notation and most of the mathematical tech- niques that are used in the body of the text. The audience is assumed to have been through sev- eral years of college-level mathematics, which included the differential and integral calculus, differential equations, functions of several variables, partial derivatives, and an introduction to linear algebra. Matrices are reviewed briefly, and determinants, vectors, and tensors of order two are described. The application of this linear algebra to material that appears in under- graduate engineering courses on mechanics is illustrated by discussions of concepts like the area and mass moments of inertia, Mohr’s circles, and the vector cross and triple scalar prod- ucts. The notation, as far as possible, will be a matrix notation that is easily entered into exist- ing symbolic computational programs like Maple, Mathematica, Matlab, and Mathcad. The desire to represent the components of three-dimensional fourth-order tensors that appear in anisotropic elasticity as the components of six-dimensional second-order tensors and thus rep- resent these components in matrices of tensor components in six dimensions leads to the non- traditional part of this appendix. This is also one of the nontraditional aspects in the text of the book, but a minor one. This is described in §A.11, along with the rationale for this approach. A.2. DEFINITION OF SQUARE, COLUMN, AND ROW MATRICES An r-by-c matrix, M, is a rectangular array of numbers consisting of r rows and c columns: ¯MM..
    [Show full text]
  • 28. Exterior Powers
    28. Exterior powers 28.1 Desiderata 28.2 Definitions, uniqueness, existence 28.3 Some elementary facts 28.4 Exterior powers Vif of maps 28.5 Exterior powers of free modules 28.6 Determinants revisited 28.7 Minors of matrices 28.8 Uniqueness in the structure theorem 28.9 Cartan's lemma 28.10 Cayley-Hamilton Theorem 28.11 Worked examples While many of the arguments here have analogues for tensor products, it is worthwhile to repeat these arguments with the relevant variations, both for practice, and to be sensitive to the differences. 1. Desiderata Again, we review missing items in our development of linear algebra. We are missing a development of determinants of matrices whose entries may be in commutative rings, rather than fields. We would like an intrinsic definition of determinants of endomorphisms, rather than one that depends upon a choice of coordinates, even if we eventually prove that the determinant is independent of the coordinates. We anticipate that Artin's axiomatization of determinants of matrices should be mirrored in much of what we do here. We want a direct and natural proof of the Cayley-Hamilton theorem. Linear algebra over fields is insufficient, since the introduction of the indeterminate x in the definition of the characteristic polynomial takes us outside the class of vector spaces over fields. We want to give a conceptual proof for the uniqueness part of the structure theorem for finitely-generated modules over principal ideal domains. Multi-linear algebra over fields is surely insufficient for this. 417 418 Exterior powers 2. Definitions, uniqueness, existence Let R be a commutative ring with 1.
    [Show full text]
  • 5 the Dirac Equation and Spinors
    5 The Dirac Equation and Spinors In this section we develop the appropriate wavefunctions for fundamental fermions and bosons. 5.1 Notation Review The three dimension differential operator is : ∂ ∂ ∂ = , , (5.1) ∂x ∂y ∂z We can generalise this to four dimensions ∂µ: 1 ∂ ∂ ∂ ∂ ∂ = , , , (5.2) µ c ∂t ∂x ∂y ∂z 5.2 The Schr¨odinger Equation First consider a classical non-relativistic particle of mass m in a potential U. The energy-momentum relationship is: p2 E = + U (5.3) 2m we can substitute the differential operators: ∂ Eˆ i pˆ i (5.4) → ∂t →− to obtain the non-relativistic Schr¨odinger Equation (with = 1): ∂ψ 1 i = 2 + U ψ (5.5) ∂t −2m For U = 0, the free particle solutions are: iEt ψ(x, t) e− ψ(x) (5.6) ∝ and the probability density ρ and current j are given by: 2 i ρ = ψ(x) j = ψ∗ ψ ψ ψ∗ (5.7) | | −2m − with conservation of probability giving the continuity equation: ∂ρ + j =0, (5.8) ∂t · Or in Covariant notation: µ µ ∂µj = 0 with j =(ρ,j) (5.9) The Schr¨odinger equation is 1st order in ∂/∂t but second order in ∂/∂x. However, as we are going to be dealing with relativistic particles, space and time should be treated equally. 25 5.3 The Klein-Gordon Equation For a relativistic particle the energy-momentum relationship is: p p = p pµ = E2 p 2 = m2 (5.10) · µ − | | Substituting the equation (5.4), leads to the relativistic Klein-Gordon equation: ∂2 + 2 ψ = m2ψ (5.11) −∂t2 The free particle solutions are plane waves: ip x i(Et p x) ψ e− · = e− − · (5.12) ∝ The Klein-Gordon equation successfully describes spin 0 particles in relativistic quan- tum field theory.
    [Show full text]
  • 2 Lecture 1: Spinors, Their Properties and Spinor Prodcuts
    2 Lecture 1: spinors, their properties and spinor prodcuts Consider a theory of a single massless Dirac fermion . The Lagrangian is = ¯ i@ˆ . (2.1) L ⇣ ⌘ The Dirac equation is i@ˆ =0, (2.2) which, in momentum space becomes pUˆ (p)=0, pVˆ (p)=0, (2.3) depending on whether we take positive-energy(particle) or negative-energy (anti-particle) solutions of the Dirac equation. Therefore, in the massless case no di↵erence appears in equations for paprticles and anti-particles. Finding one solution is therefore sufficient. The algebra is simplified if we take γ matrices in Weyl repreentation where µ µ 0 σ γ = µ . (2.4) " σ¯ 0 # and σµ =(1,~σ) andσ ¯µ =(1, ~ ). The Pauli matrices are − 01 0 i 10 σ = ,σ= − ,σ= . (2.5) 1 10 2 i 0 3 0 1 " # " # " − # The matrix γ5 is taken to be 10 γ5 = − . (2.6) " 01# We can use the matrix γ5 to construct projection operators on to upper and lower parts of the four-component spinors U and V . The projection operators are 1 γ 1+γ Pˆ = − 5 , Pˆ = 5 . (2.7) L 2 R 2 Let us write u (p) U(p)= L , (2.8) uR(p) ! where uL(p) and uR(p) are two-component spinors. Since µ 0 pµσ pˆ = µ , (2.9) " pµσ¯ 0(p) # andpU ˆ (p) = 0, the two-component spinors satisfy the following (Weyl) equations µ µ pµσ uR(p)=0,pµσ¯ uL(p)=0. (2.10) –3– Suppose that we have a left handed spinor uL(p) that satisfies the Weyl equation.
    [Show full text]
  • Matrix Determinants
    MATRIX DETERMINANTS Summary Uses ................................................................................................................................................. 1 1‐ Reminder ‐ Definition and components of a matrix ................................................................ 1 2‐ The matrix determinant .......................................................................................................... 2 3‐ Calculation of the determinant for a matrix ................................................................. 2 4‐ Exercise .................................................................................................................................... 3 5‐ Definition of a minor ............................................................................................................... 3 6‐ Definition of a cofactor ............................................................................................................ 4 7‐ Cofactor expansion – a method to calculate the determinant ............................................... 4 8‐ Calculate the determinant for a matrix ........................................................................ 5 9‐ Alternative method to calculate determinants ....................................................................... 6 10‐ Exercise .................................................................................................................................... 7 11‐ Determinants of square matrices of dimensions 4x4 and greater ........................................
    [Show full text]