Quant GT
Browse all lessons
Section 17 · Lesson 17.2

Matrix Operations

Multiplication, transposes, and matrix algebra essentials.

Matrices are linear transformations. The product ABAB composes them: applying BB then AA. Composition is associative (A(BC)=(AB)CA(BC) = (AB)C) but in general not commutative (AB≠BAAB \ne BA).

Key operations:

Transpose: A⊤A^\top swaps rows and columns. (AB)⊤=B⊤A⊤(AB)^\top = B^\top A^\top.Inverse: A−1A^{-1} exists iff AA is square and full-rank (non-zero determinant). (AB)−1=B−1A−1(AB)^{-1} = B^{-1} A^{-1}.Trace: tr(A)=∑iAii\mathrm{tr}(A) = \sum_i A_{ii}. Cyclic property tr(ABC)=tr(BCA)=tr(CAB)\mathrm{tr}(ABC) = \mathrm{tr}(BCA) = \mathrm{tr}(CAB) is endlessly useful.Determinant: scaling factor of the linear map. det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A) \det(B).

In quant work, matrix algebra appears everywhere: β^=(X⊤X)−1X⊤y\hat{\beta} = (X^\top X)^{-1} X^\top y in regression, Var(w⊤X)=w⊤Σw\mathrm{Var}(w^\top X) = w^\top \Sigma w in portfolio variance, and Markov chain transitions πPn\pi P^n for state distributions.