Ran Wei/ Linear Algebra
中文
Linear Algebra · Reference

Formula sheet

Look up a linear algebra rule, its conditions, and the lesson that explains it.

1

Vectors, maps and systems

Quantity Rule and conditions
Dot product and norm u⋅v=∑iuivi\mathbf u\cdot\mathbf v=\sum_i u_i v_i for vectors of equal length, and ∣v∣=v⋅v.|\mathbf v|=\sqrt{\mathbf v\cdot\mathbf v}\mathclose{\text{.}} Module 1
Angle cos⁡θ=(u⋅v)/(∣u∣∣v∣)\cos\theta=(\mathbf u\cdot\mathbf v)/(|\mathbf u||\mathbf v|) for nonzero vectors. Module 1
Composition ABv=A(Bv)AB\mathbf v=A(B\mathbf v) for matrices of compatible sizes. Module 3
Transpose of a product (AB)T=BTAT.(AB)^\mathsf T=B^\mathsf T A^\mathsf T\mathclose{\text{.}} Module 3
Coordinates in a basis Bc=vB\mathbf c=\mathbf v when BB has the ordered basis columns and c\mathbf c contains the coordinates. Module 4
Rank–nullity dim⁡(ker⁡A)+rank⁡(A)=n\dim(\ker A)+\operatorname{rank}(A)=n for an m×nm\times n matrix. Module 5
Solution family If Ap=b,A\mathbf p=\mathbf b\mathclose{\text{,}} the solutions are p+z\mathbf p+\mathbf z for all z∈ker⁡A.\mathbf z\in\ker A\mathclose{\text{.}} Module 5
Determinant and inverse For square A,A\mathclose{\text{,}} det⁡A≠0\det A\ne0 exactly when AA is invertible. A triangular determinant is the product of diagonal entries. Module 6
2

Orthogonality and fits

Quantity Rule and conditions
Projection onto a line u(uTb)/(uTu)\mathbf u(\mathbf u^\mathsf T\mathbf b)/(\mathbf u^\mathsf T\mathbf u) for u≠0.\mathbf u\ne0\mathclose{\text{.}} Module 7
Projection onto a subspace P=QQTP=QQ^\mathsf T if the columns of QQ are an orthonormal basis of the subspace. Module 7
Normal equations ATAx^=ATb.A^\mathsf TA\widehat{\mathbf x}=A^\mathsf T\mathbf b\mathclose{\text{.}} These characterise least-squares minimisers, with a unique coefficient vector when the columns of AA are independent. Module 8
QR solve For a thin factorisation A=QRA=QR with independent columns, solve Rx^=QTb.R\widehat{\mathbf x}=Q^\mathsf T\mathbf b\mathclose{\text{.}} Module 8
3

Spectra, singular values and data

Quantity Rule and conditions
Eigenpair Av=λvA\mathbf v=\lambda\mathbf v for square AA and v≠0.\mathbf v\ne0\mathclose{\text{.}} The candidate values solve det⁡(A−λI)=0.\det(A-\lambda I)=0\mathclose{\text{.}} Module 9
Diagonalisation A=PDP−1A=PDP^{-1} when the columns of PP form an eigenbasis and DD stores the corresponding eigenvalues. Module 9
Symmetric diagonalisation A=QΛQTA=Q\Lambda Q^\mathsf T for real symmetric AA with orthonormal eigenvectors in Q.Q\mathclose{\text{.}} Module 10
Singular values The positive σi\sigma_i are the square roots of positive eigenvalues of ATA.A^\mathsf TA\mathclose{\text{.}} For them, ui=Avi/σi.\mathbf u_i=A\mathbf v_i/\sigma_i\mathclose{\text{.}} Module 11
Condition number κ2(A)=σmax⁡/σmin⁡\kappa_2(A)=\sigma_{\max}/\sigma_{\min} for full column rank, and κ2(ATA)=κ2(A)2.\kappa_2(A^\mathsf TA)=\kappa_2(A)^2\mathclose{\text{.}} Module 11
Pseudoinverse A+=∑σi>0viuiT/σi.A^+=\sum_{\sigma_i>0}\mathbf v_i\mathbf u_i^\mathsf T/\sigma_i\mathclose{\text{.}} It gives the minimum-norm least-squares coefficients A+b.A^+\mathbf b\mathclose{\text{.}} Module 11
Truncation error ∣A−Ak∣F2=∑i>kσi2|A-A_k|_F^2=\sum_{i>k}\sigma_i^2 when AkA_k keeps the first kk singular values. Module 12
PCA For m>1m>1 centred observations in the rows of X,X\mathclose{\text{,}} the sample covariance is XTX/(m−1).X^\mathsf TX/(m-1)\mathclose{\text{.}} The first kk right singular directions give centred reconstruction XVkVkT.XV_kV_k^\mathsf T\mathclose{\text{.}} Module 12