Difference between revisions of "Linear algebra"

From Bitnami MediaWiki
Jump to navigation Jump to search
Line 67: Line 67:
 
** '''Hermitian/self-adjoint''': <math>a_{ij} = \bar{a}_{ji}</math>, where <math>\bar{a}_{ji}</math> is the conjugate of complex <math>a</math>
 
** '''Hermitian/self-adjoint''': <math>a_{ij} = \bar{a}_{ji}</math>, where <math>\bar{a}_{ji}</math> is the conjugate of complex <math>a</math>
 
* The <math>\text{diag}(\cdot)</math> operator is a mapping from <math>\R^n\mapsto \R^{n\times n}:
 
* The <math>\text{diag}(\cdot)</math> operator is a mapping from <math>\R^n\mapsto \R^{n\times n}:
 +
 
:::<math> \text{diag}((d_1,d_2,\dots,d_n)) =  
 
:::<math> \text{diag}((d_1,d_2,\dots,d_n)) =  
 
\begin{bmatrix}
 
\begin{bmatrix}

Revision as of 16:47, 14 March 2021

Some Notes on Linear Algebra

[math]\displaystyle{ \begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \end{align} }[/math]

Basics

  • Unit vector:
[math]\displaystyle{ e_i = (0,\dots,0,1,0,\dots,0) }[/math]
Order relations

Several ways to rank order vectors but no complete ordering works (vectors are only partially ordered). If for all corresponding elements [math]\displaystyle{ x_i }[/math] and [math]\displaystyle{ y_i }[/math] belonging to vectors [math]\displaystyle{ x, y }[/math], then: [math]\displaystyle{ x\gt y }[/math]

  • Partial ordering: if [math]\displaystyle{ x_i\geq y_i }[/math] then [math]\displaystyle{ x }[/math] is greater than or equal to [math]\displaystyle{ y }[/math]
  • W is a subset of V and operations in the 2 objects are the same: [math]\displaystyle{ \mathcal{W}\subseteq\mathcal{V} }[/math]
  • Intersection of 2 vector spaces of same order is a vector space; however, the union of 2 vector spaces is not necessarily a vector space (e.g., [math]\displaystyle{ v_1 + v_2 }[/math] may not be in [math]\displaystyle{ \mathcal{V}_1\cup\mathcal{V}_2) }[/math].
  • "Spaces of vectors" = a set of vectors of the same order together with the addition operator
  • For [math]\displaystyle{ \mathcal{V}_1, \mathcal{V}_2 }[/math] are disjoint vector spaces, their sum is the direct sum: [math]\displaystyle{ \mathcal{V}=\mathcal{V}_1\oplus\mathcal{V}_2 }[/math].
Cones
  • Set of vectors that contains all positive scalar multiples of any vector in the set is a cone
  • Set of vectors [math]\displaystyle{ V }[/math] is a convex cone if [math]\displaystyle{ \forall v_1, v_2 \in V }[/math] and [math]\displaystyle{ \forall a, b\geq 0 \implies av_1 + bv_2 \in V }[/math]
Inner Products

The dot product is actually a special case of the inner product (i.e., the inner product not restricted to vectors in [math]\displaystyle{ \R^3 }[/math])

[math]\displaystyle{ \langle x, y\rangle \equiv x\cdot y\equiv x^Ty = \sum_i x_i y_i }[/math]

The mapping from a vector space [math]\displaystyle{ \mathcal{V} }[/math] to [math]\displaystyle{ \R }[/math] has the following properties:

  1. Nonnegativity and identity mapping: if [math]\displaystyle{ x\neq 0 }[/math], then [math]\displaystyle{ \langle x,x\rangle \gt 0 }[/math] and [math]\displaystyle{ \langle 0,x \rangle = \langle x,0 \rangle = \langle 0,0 \rangle = 0 }[/math]
  2. Commutativity: [math]\displaystyle{ \langle x,y\rangle = \langle y,x\rangle }[/math]
  3. Factoring of scalar multiplication in dot products: [math]\displaystyle{ \langle ax, y\rangle = a\langle x,y\rangle }[/math] for real [math]\displaystyle{ a }[/math]
  4. Relation of vector addition to dot product addition: [math]\displaystyle{ \langle x+y,z \rangle = \langle x,z\rangle + \langle x,z\rangle }[/math]
The Cauchy-Schwarz Inequality
[math]\displaystyle{ \langle x,y\rangle \leq \langle x,x\rangle^{\frac{1}{2}} \langle y,y\rangle^{\frac{1}{2}} }[/math]

Norms

A function [math]\displaystyle{ \parallel\cdot\parallel }[/math] from a set of objects [math]\displaystyle{ S }[/math] to [math]\displaystyle{ \R }[/math] satisfying 3 conditions

  1. Nonnegativity and identity mapping: [math]\displaystyle{ x\neq 0 \implies \parallel x\parallel \gt 0 }[/math] and [math]\displaystyle{ \parallel 0 \parallel = 0 }[/math]
  2. Relation of scalar multiplication to real multiplication: [math]\displaystyle{ \parallel ax\parallel = |a|\parallel x\parallel }[/math] for real [math]\displaystyle{ a }[/math]
  3. Triangle inequality: [math]\displaystyle{ \parallel x+y\parallel\; \leq\; \parallel x\parallel + \parallel y\parallel }[/math]

General case: [math]\displaystyle{ || x||_p = \left (\displaystyle\sum_i |x_i|^p\right ) ^{\frac{1}{p}} }[/math]

  • Manhattan: [math]\displaystyle{ ||x||_1 = \sum_i|x_i| }[/math]
  • Euclidean: [math]\displaystyle{ || x||_2 = \sqrt{\sum_i x_i^2} = \sqrt{\langle x,x\rangle} }[/math]
  • Chebyshev: [math]\displaystyle{ || x||_\infty = \max_i|x_i| }[/math] (take limit of the [math]\displaystyle{ L_p\; }[/math]/Minkowski norm)
  • Magnitude of the norm falls as [math]\displaystyle{ p }[/math] increases because you're taking a bigger root (1/p). More formally, [math]\displaystyle{ ||x||_p }[/math] is a non-increasing function of [math]\displaystyle{ p }[/math]
  • For any inner product space, a ([math]\displaystyle{ L_2 }[/math]) norm is induced by the inner product: [math]\displaystyle{ ||x|| = \sqrt{\langle x,x\rangle} }[/math]
  • Induced norm for the sum of two vectors: [math]\displaystyle{ ||x+y||^2 = ||x||^2 + ||y||^2 + 2\langle x,y\rangle }[/math]
  • Normalized vector: [math]\displaystyle{ \tilde{x} = \frac{1}{||x||}x }[/math]

Standard Deviation, Variance and Scaled Vectors

  • A centered vector is just one with the mean subtracted off: [math]\displaystyle{ x_c = x - \bar{x} }[/math]
  • A scaled vector : [math]\displaystyle{ x_s = \sqrt{n-1}\frac{x_c}{||x_c||} }[/math]
  • A centered and scaled (aka "standardized") vector: [math]\displaystyle{ x_{cs} = \sqrt{n-1}\frac{x_c}{||x_c||} }[/math]
  • The standard deviation is the multiplicative inverse of the scaling factor: [math]\displaystyle{ s_x = \frac{||x_c||}{\sqrt{n-1}} }[/math]
  • The square of the standard deviation is the variance: [math]\displaystyle{ V(x) = s_x^2 = \frac{||x_c||^2}{n-1} }[/math]
Covariances and Correlations Between Vectors
  • For n-vectors x and y, their covariance is [math]\displaystyle{ \text{Cov}(x,y) = \dfrac{\langle x-\bar{x}, y -\bar{y}\rangle}{n-1} }[/math] where
    • [math]\displaystyle{ \text{Cov}(x+y,y) = \text{Cov}(x,y) + V(y)\quad }[/math] and
    • [math]\displaystyle{ \text{Cov}(x+a,y) = \text{Cov}(x,y) }[/math]

Matrices

  • The vector space generated by the columns of the [math]\displaystyle{ n\times m }[/math] matrix [math]\displaystyle{ A }[/math] is of order [math]\displaystyle{ n }[/math] and dimension [math]\displaystyle{ m }[/math] or less and is called the column space or range of [math]\displaystyle{ A }[/math], denoted [math]\displaystyle{ \mathcal{V}(A) }[/math] or [math]\displaystyle{ \text{span}(A) }[/math]
  • The row space is the vector space of order [math]\displaystyle{ m }[/math] generated by the rows of [math]\displaystyle{ A }[/math]
  • Diagonals and other elements
    • diagonal: composed of elements [math]\displaystyle{ a_{ii} }[/math] (aka principal diagonal elements)
    • co-diagonals: elements [math]\displaystyle{ a_{i, i+c_k} }[/math]
    • skew diagonals: for [math]\displaystyle{ m }[/math] columns, the [math]\displaystyle{ a_{i,m+1-i} }[/math] elements
    • skew symmetric: a matrix [math]\displaystyle{ A }[/math] such that [math]\displaystyle{ a_{ij} = -a_{ji} }[/math]. (Diagonal entries are 0.) Also means [math]\displaystyle{ -A = A^T }[/math]
    • Hermitian/self-adjoint: [math]\displaystyle{ a_{ij} = \bar{a}_{ji} }[/math], where [math]\displaystyle{ \bar{a}_{ji} }[/math] is the conjugate of complex [math]\displaystyle{ a }[/math]
  • The [math]\displaystyle{ \text{diag}(\cdot) }[/math] operator is a mapping from [math]\displaystyle{ \R^n\mapsto \R^{n\times n}: :::\lt math\gt \text{diag}((d_1,d_2,\dots,d_n)) = \begin{bmatrix} \,\,d_1 & \,0 & \cdots & 0\,\\ \,\,0 & d_2 & \cdots & 0\,\\ \,\,\vdots & & \ddots & \,\\ \, \,0 & 0 & \cdots & d_n\,\\ \end{bmatrix} }[/math]

Derivatives and Integrals

Transformations and Factorizations

Solution of Linear Systems

Evaluation of Eigenvalues and Eigenvectors

Special Matrices, Modeling and Data Analysis

Applications in Statistics