Determinant and Inverse

1 min read

The determinant det(A)\det(A) of a square matrix is a scalar that captures how the transformation scales volume:

  • det(A)|\det(A)| = factor by which AA scales nn-dimensional volume
  • det(A)<0\det(A) < 0 means the transformation reverses orientation (mirror)
  • det(A)=0\det(A) = 0 means the transformation collapses a dimension → AA is singular (not invertible)

Key properties:

  • det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B)
  • det(A)=det(A)\det(A^\top) = \det(A)
  • det(A1)=1/det(A)\det(A^{-1}) = 1/\det(A)
  • For triangular matrices: product of diagonal entries

The inverse A1A^{-1} exists iff det(A)0\det(A) \neq 0, and satisfies AA1=A1A=IAA^{-1} = A^{-1}A = I.

Solving Ax=bA\mathbf{x} = \mathbf{b}: if AA is invertible, x=A1b\mathbf{x} = A^{-1}\mathbf{b}. In practice, use Gaussian Elimination (LU decomposition) — never actually compute A1A^{-1}.

Where this matters in ML:

  • Multivariate Gaussians: p(x)exp(12(xμ)Σ1(xμ))p(\mathbf{x}) \propto \exp(-\frac{1}{2}(\mathbf{x}-\mu)^\top \Sigma^{-1}(\mathbf{x}-\mu)) requires Σ\Sigma to be invertible → must be positive definite
  • Maximum Likelihood Estimation for Gaussians involves det(Σ)\det(\Sigma) in the normalizing constant
  • Change of variables in normalizing flows: p(x)=p(z)det(J)1p(\mathbf{x}) = p(\mathbf{z})|\det(J)|^{-1} where JJ is the Jacobian Matrix
  • A near-singular matrix (small determinant) means ill-conditioning → numerically unstable gradients

See also: Gaussian Elimination, Eigendecomposition, Positive Definite Matrices

Linked from