Professional Documents
Culture Documents
Singular Value Decomposition: UWV A
Singular Value Decomposition: UWV A
A = UWV T
Tim Cootes Diagonal elements
are called
mxn nxn ‘Singular Values’
nxn
Orthogonal columns Orthonormal
UT U = I n (Pure rotation)
VV T = V T V = I n
A = UWV T
• Eigenvector decomposition is a special case of
SVD for square, symmetric matrices
A = UWV T
1
Geometric Interpretation Geometric interpretation
• For m=n case
⎛ 0⎞ x → VT x
⎜⎜ ⎟⎟
Ax = UWV x T ⎝1⎠
θ
⎛ 1⎞ (Rotation)
⎜⎜ 0 ⎟⎟
Pure ⎝ ⎠
Scale along Pure
Rotation each axis Rotation
x → UWV T x x → Wx
(Scaling)
x → Ux
(Rotation)
(Rotation)
2
2D Case Rounding errors
test_rounding.m
|Singular values| >> 0 Singular value near zero
|Determinant| >>0 Determinant near zero
x2 x2
a=1.0;
d=1.0;
while abs(d-1.0)<1e-6
Solution point a=10*a;
well defined Solution point d=(a+1.0)-a;
becomes unstable disp(['a=' num2str(a)
x1 x1
'(a+1)-a=' num2str(d)]);
end
Output Precision
a=10 (a+1)-a=1
a=100 (a+1)-a=1 test_precision.m
a=1000 (a+1)-a=1
a=10000 (a+1)-a=1
a=100000 (a+1)-a=1 d=1.0;
a=1000000 (a+1)-a=1 while (1.0+d)>1.0
a=10000000 (a+1)-a=1 d=d/10.0;
a=100000000 (a+1)-a=1 disp(['d=' num2str(d,18) ' 1+d=' num2str(1+d,18)]);
a=1000000000 (a+1)-a=1
end
a=1.000000e+010 (a+1)-a=1
a=1.000000e+011 (a+1)-a=1
a=1.000000e+012 (a+1)-a=1
a=1.000000e+013 (a+1)-a=1
a=1.000000e+014 (a+1)-a=1
a=1.000000e+015 (a+1)-a=1
a=1.000000e+016 (a+1)-a=0
Output Rank
d=0.10000000000000001 1+d=1.1000000000000001
d=0.01 1+d=1.01 • The rank of matrix A is the number of
d=0.001 1+d=1.0009999999999999
d=0.0001 1+d=1.0001 linearly independent columns of A
d=1.0000000000000001e-005 1+d=1.0000100000000001
d=1.0000000000000002e-006 1+d=1.0000009999999999 = Number of non-zero singular values of A
d=1.0000000000000002e-007 1+d=1.0000001000000001
d=1.0000000000000002e-008 1+d=1.0000000099999999 • n x n A is full rank if rank(A)=n
d=1.0000000000000003e-009 1+d=1.0000000010000001
d=1.0000000000000003e-010 1+d=1.0000000001
d=1.0000000000000003e-011 1+d=1.00000000001
d=1.0000000000000002e-012 1+d=1.0000000000010001
d=1.0000000000000002e-013 1+d=1.0000000000000999
d=1.0000000000000002e-014 1+d=1.00000000000001
d=1.0000000000000001e-015 1+d=1.0000000000000011
d=1.0000000000000001e-016 1+d=1
3
Underdetermined Systems Underdetermined Systems
• If there are fewer equations than
m<n m = 2 equations Ax = x1a1 + x2a 2 + x3a 3 = b
n = 3 unknowns
unknowns, then the system is called 2D vectors
underdetermined
– Usually an infinite number of possible
solutions a1 a2 b
a3
1 / wi if wi > t
x2 x2
Define zi = {
0 otherwise
⎛ z1 0 L 0⎞ Solution point is
The solution is then ⎜ ⎟ around here
x = UZV b ⎜0
T z2 L 0⎟
Z=⎜ somewhere
M M O M⎟
⎜ ⎟ x1
⎜0 L z n ⎟⎠
x1
⎝ 0
4
Overdetermined Case Overdetermined Case
Ax = x1a1 + L + xna n = b • Vector between Ax and b is Ax-b
• a are columns of A (m-D vectors) • Square of distance between Ax and b is
• In general, cannot reach b if n<m d 2 =| Ax − b |2 = ( Ax − b)T ( Ax − b)
• So find x which gets as close as possible
b2 x1a1 • The solution is usually defined as the x
m = 2 equations which minimises this distance
n = 1 unknown a1 Closest point on line to b
b
b1
A = LLT A = LU
Successful Failed or Successful
and |A|>0 |A| near 0 and |A| not 0
Solve using
Cholesky Solve using
Solve using LU
backsubstitution
SVD backsubstitution
5
Iterative improvement QR Decomposition
• Solution to Ax=b can contain rounding • Any matrix A can be decomposed as
errors
A = QR
Suppose x i is current estimate of sol n to Ax = b
m× n m×n n× n
Then a better sol n is x i +1 = x i − dx i orthogonal upper triangular
where dx i is the sol n to A (dx i ) = ( Ax i − b) Q Q = In
T
6
Orthonormal Basis Orthonormal Basis
• Given an arbitrary set of basis vectors we • If p is a point in the subspace, then
can generate an orthonormal basis using p = x1u1 + L + xk u k = Ux
SVD
x = UT p
(a1 L a k ) = A = UWV T
The projection of p along line xu is u.p = uT p
= (u1 L u k ) WV T
p
Columns of U give an orthonormal
basis for subspace
θ
u
1 u.p