Matrices and Vectors
- Identify the dimensions of a matrix, locate any element using row-column subscript notation, and distinguish row vectors from column vectors
- Recognise symmetric, diagonal, triangular, identity, and zero matrices on sight and state a key property of each
- Explain the convention that a vector is assumed to be a column vector unless otherwise stated, and apply the subscript notation for rows and columns of a data matrix
What Is a Matrix?
A matrix is a rectangular array of numbers arranged in rows and columns. We denote a matrix by a bold capital letter, and its typical element by a subscripted lowercase:
The subscript always reads row, then column — so is the element in row , column . This convention is universal and worth internalizing early.
Dimensions
The dimensions of a matrix are its row count and column count, written (read "n by K"). We say is an matrix if it has rows and columns.
- When , the matrix is square.
- When , the matrix is a row vector.
- When , the matrix is a column vector.
Special Matrix Types
Several structured matrices appear constantly in ML and statistics. Recognizing them on sight saves significant algebra.
Symmetric Matrix
A matrix is symmetric if it equals its own transpose:
Covariance matrices and kernel matrices are always symmetric. This makes them diagonalizable with real eigenvalues — a key fact for PCA and Gaussian geometry.
Diagonal Matrix
A diagonal matrix is a square matrix whose only nonzero entries lie on the main diagonal (top-left to bottom-right):
Diagonal matrices represent independent scaling along each coordinate axis. In 3D Gaussian Splatting, isotropic Gaussians use diagonal scale matrices.
Scalar Matrix
A scalar matrix is a diagonal matrix with the same value in every diagonal position: . It scales all directions equally.
Identity Matrix
The identity matrix (or to specify order ) is a scalar matrix with ones on the diagonal:
It is the multiplicative identity for matrices: for any conformable .
Triangular Matrices
A lower triangular matrix has zeros everywhere above the main diagonal; an upper triangular matrix has zeros below it:
Triangular matrices are important in LU decomposition and Cholesky factorization of covariance matrices.
Zero (Null) Matrix
The zero matrix has every element equal to zero. It is the additive identity: .
Vectors
A vector is a matrix with exactly one row or one column.
- A column vector is . Unless otherwise stated, a vector is assumed to be a column vector.
- A row vector is — the transpose of the column vector.
Vectors carry geometric meaning: you can think of as a point in -dimensional space, or as an arrow from the origin to that point.
Indexing Conventions for Rows and Columns
We need consistent notation to refer to individual rows and columns of a matrix :
- or denotes column of (a column vector)
- or denotes the column vector formed by transposing row of
So when we write , we typically mean the -th observation as a column vector — the transpose of the -th row of the data matrix . This subscript-based convention eliminates most ambiguity in econometric and ML notation.