linear algebra is a form of continuous rather than discrete mathematics
detailed information --> Matrix Cookbook (Petersen and Pedersen, 2006)
Scalars:–>(ponit)
A scalar is just a single number
a=aT
Vectors:–>(line)
A vector is an array of numbers, the numbers are arranged in order.A standard column vevtor
Matrices:–>(face)
A matrix is a 2-D array of numbers, so each element is indentified by tow indices.
Note:transpose for matrix:(AT)i,j=Aj,i
C=A+B where Ci,j=Ai,j+Bi,j.
Tensors:–>(volume)
A tensors is an array of numbers arranges on a regular grid with a variable number of axes.
NOTE: D=a⋅B+c, where Di,j=a⋅Bi,j+c
Broadcasting: C=A+b, where Ci,j=Ai,j+bj.
matrix product:
C=AB, where Ci,j=k∑Ai,kBk.j
also called element-wise product or Hadamard product and denoted as A⊙B
distribution:A(B+C)=AB+AC
association:A(BC)=(AB)C
uncommutation: AB̸=BA
transpose: (AB)T=BTAT
dot product: (for two vector x and y)
likely martix product xTy
communication:xTy=yTx
linear equations:
Ax=b, where A∈Rm×n is a known matrix, b∈Rm is a known vector, and x∈Rn is a vector of unknown variables to be solved.
matrix inversion
denoted by A−1, and define as A−1A=In
identity matrix
In∈Rn×n, and we have ∀x∈Rn,Inx=x
Linear Dependence
The geometry meaning of linear equations A=⎣⎢⎢⎢⎡a1,1a2,1⋮aN,1a1,2a2,2⋮aN,2⋯⋯⋱⋯a1,Na2,N⋮aN,N⎦⎥⎥⎥⎤=[A:,1A:,2⋯A:,N]
linear combination
{v(1),⋯,v(n)} is given by i∑civ(i)
Span
the span of a set of vectors is the set of all points obtainable by linear combination of the original vectors.
if Ax=b has a solution, b is in the span of the columns of A.–> column space or the range of A.
n≥m is the necessary condition
A set of vectors is linearly independent if no vector om the set is a linear combination of the oter vectors.
A square matrix with linearly dependent colums is known as singular.
For square matrices, the left inverse and the right inverse are equal.
Norms
measure the size of vectors
Lp norm is given by ∥x∥p=(i∑∣xi∣p)p1 for p∈R,p≥1
functions mapping vectors to non-negative values.
satisfies the properties:
f(x)=0=>x=0
f(x+y)≤f(x)+f(y) (the triangle inequality)
∀α∈R,f(αx)=∣αf(x)∣
L2 is the Euclidean norm between the origin and the point x.
denoted as ∥x∥, calculated as x2.
increases very slowly near the origin.
L1 is the grows at the same rate in all locations.
∥x∥1=i∑∣xi∣
L0 measure the size of the vector by counting its number of nonzero elements.
not a norm, always used L1 as a substitute.
L∞ known as the max norm
∥x∥∞=imax∣xi∣
L2 of matrix is Frobenius norm
used to measure the size of a matrix
∥A∥F=i,j∑Ai,j2
Represented dot product by norms: xTy=∥x∥2∥y∥2cosθ, where θ is the angle between x and y.
Special Kinds of Matrices and Vectors
Diagonal matrices:
D is a diagonal, if and only if Di,j=0 for all i̸=j.
diag(v) denote the diagonal matrix whose diagonal entries are given by the vector v.
diag(v)x=v⊙x
if every diagonal entry is nonzero, diag(v)−1=diag([1/v1,⋯,1/vn]).
for a non-square diagonal matrix D, if D is taller than it is wide, concatenating some zeros to the results; if D is wider than it is tall, discarding some of the last elements of the vector.
symmetric matrix:
A=AT
unit vector
unit norm: ∥x∥2=1
orthogonal: xTy=0
orthonormal: orthogonal and unit
orthogonal matrix:
ATA=AAT=I
Implies: A−1=AT
Eigendecomposition
decompose a matrix into a set of eigenvectors and eigenvalues.
eigenvector and eigenvalues
a square matrix A, a non-zero vector v,satisfied Av=λv.
λ is the eigenvalue corresponding to this eigenvector v. ++Also there are left eigenvectorvTA=λvT++
for s∈R,s̸=0, if v is an eigenvector of A, then sv has the same eigenvalue.
let V=[v(1),⋯,v(1)],λ=[λ1,⋯,λn]T, then Vdiag(λ)=AV, namely A=Vdiag(λ)V−1.
every real symmetric matrix can be decomposed
A=QΛQT, where Q an orthogonal matrix composed of eigenvectors of A and Λ is a diagonal matrix.
the eigenvalue Λi,i is associated with the eigenvector Q:,i
is not unique.
if any of eigenvalues are zero, the matrix is singluar
eigendecomposition:
f(x)=xTAx, subject to ∥x∥2=1.
if x is the eigenvector of A, f is the eigenvalue.
the maximum/minimum value of f is the maximum/minimum eigenvalue
positive definite: a matrix with all positive eigenvalue.xTAx=0==>x=0
positive semidefinite: a matrix with all positive or zero eigenvalue.==>∀x,xTAx≥0
negative definite
negative semidefinite
Singular Value Decompsition:
every real matrix has a singular value decomposition
A=UDVT,Am×n,Um×m,Dm×n,Vn×n.
U,V is the orthogonal matrix
D is the diagonal matrix and is the singular value of A
the columns of U are the left-singular vectors.
the columns of V are the right-singular vectors.
The Moore-Penrose Pseudoinverse
define: A+=α↘0lim(ATA+αI)−1AT
AA+A=A
A+AA+=A+
AA+,A+A are symmetric
Compute: A+=VD+UT, where U,V,D are the singular value decomposition of A.
if A is a wide matrix, x=A+y with the minimal Euclidean norm among all possible solutions.
if A is a tall matrix, Ax is as close as possible to y.
Trace Operator
Define: Tr(A)=i∑Ai,i
Frobenius norm of a matrix: ∥A∥F=Tr(AAT)
Tr(A)=Tr(AT)
Tr(ABC)=Tr(CAB)=Tr(BCA), more generally, Tr(i=1∏n)=Tr(F(n)i=1∏n−1F(i))
a=Tr(a)
The Determinant
define for a square matrix: det(A)=i=1∏nλi
The absolute value of the determinant can be thought of as a measure of how much multiplication by the matrix expands or contracts space.
If the determinant is 0, then space is contracted(收缩) completely along at leastone dimension, causing it to lose all of its volume.
If the determinant is 1, thenthe transformation preserves(保留) volume.