














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















Math for CS
Lecture 4
1
Consider an equation for a stretched beam:Y = x
Where x
is the original length, T is the force applied and x 1 is the inverse coefficient of stiffness.Suppose that the following measurements where taken:T 10
Corresponding to the overcomplete system:11.60 = x1 + x2 1011.85 = x1 + x2 15
12.25 = x1 + x2 20
Math for CS
Lecture 4
Problem: Given A(m x n), m
ïn, b(m x 1) find
x (n x 1) to minimize
||A x -b||
-^ If
m > n
, we have more equations than the number of unknowns, there is generally no x satisfying Ax=bexactly.• This is an overcomplete
system
Math for CS
Lecture 4
0LQLPL]HWKHVTXDUHG(XFOLGHDQQRUPRIWKHUHVLGXDOYHFWRU 7RPLQLPL]HZHWDNHWKHGHULYDWLYHZLWKUHVSHFWWR[DQGVHWLWWR]HUR:KLFKUHGXFHVWRDQ
Q[Q
OLQHDUV\VWHPFRPPRQO\
NQRZQDV1250$/(48$7,216
Normal Equations 1
Math for CS
Lecture 4
Normal Equations 2
11.60 = x1 + x2 1011.85 = x1 + x2 1512.25 = x1 + x2 20
x^
b min||A
x -b||
2
Math for CS
Lecture 4
-^ A matrix Q is said to be orthogonal if its columns areorthonormal, i.e. Q
-^ Orthogonal transformations preserve the Euclidean normsince •^ Orthogonal matrices can transform vectors in variousways, such as rotation or reflections but they do notchange the Euclidean length of the vector. Hence, theypreserve the solution to a linear least squares problem.
Math for CS
Lecture 4
Any matrix
A^ (m·n)
can be represented as
,where
Q(m·n)
is orthonormal and
R(n·n)
is upper triangular:
^
@^ >^
@
∫ ª ª ª ª º ™ ´ ´ò ´ ´ ¨
n nn
n n
r r
r rr q q a a
(^00) 0 00 0 |...| |...|
11
1 (^1211) 1 1
! !!^ !!
Math for CS
Lecture 4
QR^ decomposition only work
, V(n x n)
are orthogonal is an (m x n) diagonal matrix (singular values of A)The minimal solution corresponds to:
Math for CS
Lecture 4
Matlab Code:
Math for CS
Lecture 4
13
$SSUR[LPDWLRQE\DORZ
UDQNPDWUL[
(^
) (^
) {^
}^
(^
)^
1 2
2 2 )(rank:
2
(^21)
1
(^21)
1
min
in ion to approximat rankbest theIs
~diag( , ~
Then
,of SVDthe be
let
rankhave let:II Fact
= = × =
= ∑
∑
r
r
r
r i
T ii i
p
p i
T ii i nm r
pr
p
T
XX
T
T
vu A
vu VU A
Math for CS
Lecture 4
*HRPHWULF,QWHUSUHWDWLRQRIWKH
69'
x Ab nm^
òu
The image of the unit sphere under any m
x n matrix is a
hyperellipse
v^1
v^2
·v^2
·v^1
Math for CS
Lecture 4
6LQJXODU9DOXH'HFRPSRVLWLRQ
(^1) î^ i^ î^ n
),( 1 2 ),( (^21) ),( (^21) ), (
n^ nn
n nm n nn nm
uu u
A
∫ ª ª ª ª º ™∫´ª´ª´ª´º¨ ™∫ ´ª ´ª ´ª¨º
∫ ª™ª´ª´ª´¨ª ªº ™ ´ ´ ´ ´ ´ ´¨
V V V
QQQ
! ! !^6 UAV Matrices U,V are orthogonal and
is diagonal *****^ - Singular Value decomposition VU A^
6
Math for CS
Lecture 4
0DWULFHVLQWKH'LDJRQDO)RUP Every matrix is diagonal in appropriate basis:Any vector
b can be expanded in the basis of left singular vectors of A {u(m,1)^
};i
Any vector
x can be expanded in the basis of right singular vectors of A {v(n,1)^
};i
Their coordinates in these new expansions are:Then the relation b=Ax can be expressed in terms of b
’ and x’: x Ab nm^
òu
xV x bU b^
ò
ò^
*****^
’ ; ’
’
***^
x b xV UU xA Ub U xA b^
6 ú 6
ò ú
Math for CS
Lecture 4
'HWHUPLQDQWRI$
For A
,(m,m) Proof:The^
determinant
of a
product
of^ square
matrices
is^ the
product of their determinants. The determinant of a Unitarymatrix is 1 in absolute value, since: U
m ñ i i *^ U=I. Therefore,
V
6 ñ
6
6
m i i V U VU A^
**1
*****^
|) det(||) det(||) det(||) det(||) det(||) det(|
V
Math for CS
Lecture 4
For A
, can be written as a sum of r rank-one matrices:(m,n)
Proof:If we write
as a sum of
, wherei
=diag(0,..,i^
,..0), theni^
(1) Follows from
$LQWHUPVRIVLQJXODUYHFWRUV
r ¶ j
vujjj A^
1
V
***** V U A^
6