Why symmetric matrices are special
The topic Determinants and eigenvalues ended on a warning. A general matrix may have too few eigenvectors, or complex ones: a rotation by has eigenvalues , and the shear has a single eigen-direction. Even when an eigenbasis exists, it is usually not orthogonal: the running example of that topic has eigenvectors and at an angle of about .
This topic is about matrices where none of that happens. A square matrix is symmetric if it equals its transpose:
The entries mirror each other across the main diagonal. That sounds like a special case, but in ML symmetric matrices are the rule:
- a covariance matrix, since ;
- the Gram matrix of a data matrix , which already appeared in the normal equations (see the topic Inner products, norms and orthogonality);
- a kernel matrix built from a symmetric similarity ;
- the Hessian of a loss, its matrix of second derivatives (the topic Gradients, Jacobians and Hessians).
Why is symmetric takes one line with the rule :
Nothing here needs to be square: the data matrix is , with one example per row.
The running example of the topic is
Later it will turn out to be the covariance of a tiny dataset.