NOTE / 5/5/2020

Solving an Overdetermined Homogeneous System Ax = 0

SLAMTechnical NotesSLAMVIOsensor fusion

Many engineering problems reduce to solving an overdetermined homogeneous system, where A\mathbf A is a matrix and the unknown is x\mathbf x. Examples include map-point triangulation in SLAM and some PnP formulations. The system clearly has the zero solution, but that is not the solution we seek; we want a nonzero x\mathbf x.

To obtain a nonzero solution, constrain x\mathbf x with ∥x∥2=1\|\mathbf x\|^2=1. In other words, constrain its length to one and form the following constrained least-squares problem:

x^=argmin⁡∥Ax∥2, subject to ∥x∥2=1 (1)\hat{\mathbf x} = \text{arg} \min \|\mathbf{Ax}\|^2,\text{ subject to } \|\mathbf x\|^2=1 \tag{1} \\

This is a constrained least-squares problem, so introduce a Lagrange multiplier:

L(x,λ)=∥Ax∥2+λ(1−∥x∥2)=xTATAx+λ(1−xTx)(2)\begin{align} L(\mathbf x, \lambda) &= \|\mathbf {Ax}\|^2 + \lambda(1 - \|\mathbf x\|^2) \\ &= \mathbf{x}^T\mathbf{A}^T\mathbf {Ax} + \lambda(1-\mathbf x^T \mathbf x) \end{align} \tag{2}\\

To find an extremum, differentiate with respect to x\mathbf x and λ\lambda, then set both derivatives to zero:

∂L(x,λ)∂x=2ATAx−2λx=0∂L(x,λ)∂λ=1−xTx=0\begin{align} \frac{\partial L(\mathbf x, \lambda)}{\partial \mathbf x} &= 2\mathbf A^T \mathbf {Ax} - 2\lambda \mathbf x = 0 \tag{3}\\ \frac{\partial L(\mathbf x, \lambda)}{\partial \lambda} &= 1- \mathbf x^T\mathbf x = 0 \tag{4} \end{align} \\

Rearranging equation (3) gives:

(ATA−λI)x=0ATAx=λx\begin{align} (\mathbf A^T \mathbf{A} - \lambda \mathbf I) \mathbf x = 0 \tag{5} \\ \mathbf A^T \mathbf{Ax} = \lambda \mathbf x \tag{6} \end{align}

Therefore λ\lambda and x\mathbf x are, respectively, an eigenvalue and eigenvector of ATA\mathbf A^T\mathbf A. The solution to (1) must be one of these eigenvectors.

Which eigenvector should we choose? Expand ∥Ax∥2\|\mathbf {Ax}\|^2:

∥Ax∥2=xTATAx=xTλx=λxTx=λ(7)\|\mathbf {Ax}\|^2 = \mathbf x^T\mathbf A^T \mathbf A \mathbf x = \mathbf x^T \lambda\mathbf x = \lambda \mathbf x^T\mathbf x = \lambda \tag{7}\\

The derivation of (7) uses equation (6) and the unit-norm constraint.

To minimize ∥Ax∥2\|\mathbf {Ax}\|^2, we need the smallest λ\lambda.

Thus, the nonzero solution of equation (1) is the eigenvector of ATA\mathbf A^T\mathbf A associated with its smallest eigenvalue λ\lambda.

References

  1. Karel Zimmermann. Lecture notes: overdetermined homogeneous linear system.
  2. Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision.