Matrices as Inner Products
This concept, bridges the gap between abstract vector operations and concrete matrix representations. It shows how matrices can define custom inner products, which allows us to create flexible, data-dependent geometric spaces.
1. The Intuitive Core (The ‘Why’)
So far, we’ve treated the standard dot product (x⊤y) as the only way to calculate an inner product. This is like assuming that the only way to measure distance in a city is “as the crow flies” (Euclidean distance).
But what if we wanted a different way to measure the relationship between two vectors? What if we wanted to say that certain directions in our data space are “more important” or “longer” than others?
This is where matrices come in. A symmetric, positive definite matrix can be used to define a custom inner product. You can think of this matrix as a “rulebook” or a “metric tensor” that redefines the geometry of the vector space. It stretches and rotates the space, changing our fundamental notions of length, angle, and distance.
Analogy: Imagine a piece of stretchy fabric.
- The standard inner product () is like measuring distances on the flat, unstretched fabric.
- A custom inner product, defined by a matrix as , is like stretching and weighting the fabric. Distances and angles change. Two points that were close might now be far apart, and directions that were perpendicular might not be anymore, all according to the “stretching rules” defined by matrix .
The problem this solves is creating data-dependent geometry. Instead of using a one-size-fits-all Euclidean space, we can use a matrix (often derived from the data itself) to define an inner product that is tailored to the structure of our specific problem.
2. The Mathematical Deep Dive (The ‘How’)
The standard Euclidean inner product is:
Notice the identity matrix hidden in the middle. The insight is that we can replace this identity matrix with any symmetric, positive definite matrix to create a new, valid inner product.
This generalized inner product is defined as:
For this to be a valid inner product, the matrix must be symmetric and positive definite. Let’s see why:
- Symmetry: We need . Let’s check: . Since the result is a scalar, we can transpose it without changing its value: . For this to equal the original , we must have . So, A must be symmetric.
- Linearity: This property holds due to the distributive property of matrix multiplication. .
- Positive Definiteness: We need for all . By definition, . The condition that this quantity must be positive for any non-zero vector x is precisely the definition of a positive definite matrix.
So, any symmetric, positive definite matrix A gives rise to a valid inner product. This new inner product, in turn, defines a new norm and distance metric:
- Induced Norm (Mahalanobis Norm): .
- Induced Distance (Mahalanobis Distance): .
Connections
- Forward Links:
- Backward Links: Matrix, Matrices as Linear Transformation, Inner Products