

















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!


















the sea
One application is geodesy & surveying. Let z = elevation, and suppose we have the mea-
surements:
zA ≈ 1 .,
zB ≈ 2 .,
zC ≈ 3 .,
zB − zA ≈ 1 .,
zC − zB ≈ 2 .,
zC − zA ≈ 1.
This is overdetermined and inconsistent:
1 0 0
0 1 0
zA
zB
zC
Another application is fitting a curve to given data:
x 1 1
x 2 1
. . .
xn 1
a
b
y 1
y 2
. . .
yn
More generally Am×nxn ≈ bm where A is known exactly, m ≥ n, and b is subject to inde-
pendent random errors of equal variance (which can be achieved by scaling the equations).
Gauss (1821) proved that the “best” solution x
minimizes ‖b − Ax‖ 2 ,
i.e., the sum of the squares of the residual components. Hence, we might write Ax ≈ 2 b.
Even if the 2-norm is inappropriate, it is the easiest to work with.
3.1 The Normal Equations
3.2 QR Factorization
3.3 Householder Reflections
3.4 Givens Rotations
3.5 Gram-Schmidt Orthogonalization
3.6 Singular Value Decomposition
analytical argument
Let rank(A) = n. Therefore A
T A is nonsingular. Let x satisfy A
T r = 0 where r = b − Ax.
Then for any other value x + w
‖b − A(x + w)‖
2 2 =^ ‖r^ −^ Aw‖
2 2 =^ r
T r − 2 w
T A
T r + w
T A
T Aw
= ‖b − Ax‖
2 2 +^ ‖Aw‖
2
Hence, a solution of the normal equations is a solution of the least squares problem. The
solution x is a unique minimum if rank(A) = n because then ‖w‖
2 = 0 ⇒ w = 0.
r−Aw
Aw
r
R(A)
Ax
b
the pseudo-inverse
Assume rank(A) = n. Then
x = (A
T A)
− 1 A
T b.
We call (A
T A)
− 1 A
T = A
† the pseudo-inverse and we write
x = A
† b.
(The definition can be extended to the case rank(A) < n.) For a column vector v the pseudo-
inverse v
† = v
T /‖v‖
2 2.^ The product^ A
† A = In×n:
What about AA
† ? This is an orthogonal projector.
orthogonal projector
The product
vv
T
vTv
= vv
† produces an orthogonal projection of a vector onto span{v} because
† x ∈ span{v},
† x⊥ span {v}.
Alternatively,
vv
T
vTv
x is the closest vector to x that is some multiple of v.
T
T
x vv
vv
v
x
Similarly
AA
† = A(A
T A)
− 1 A
T , rank (A) = n ≤ m,
produces an orthogonal projection onto R(A), because AA
† b ∈ R(A) (since AA
† b = A(A
† b)).
For any b
b − AA
† b⊥R(A)
since A
T (b − AA
† b) = 0.
DEFN A matrix P is an orthogonal projector if for any x
x − P x⊥R(P )
⇔ ∀x (x − P x)
T P = 0
T P = P
T = P P
2 = P
symmetry idempotence
If S is a subspace of R
n , then its orthogonal complement S
⊥ := {x|x
T y = 0 for all y ∈ S}.)
Every v ∈ R
n has a unique decomposition v = x + y, x ∈ S, y ∈ S
⊥ .
solving the normal equations
The direct approach to solving (A
T A)x = A
T b is to
T A,
m + n unknowns where m and n are the dimensions of A.
to the least squares problem.
′ is the orthogonal projection of y onto a subspace S, what two conditions does y
′
satisfy?
vv
T
vTv
do?
a 2 ,... , an for S.
tor?
(b) What is the projector onto the orthogonal complement of R(A)?
(c) What is the projector onto R(A)?
T is orthogonal only
if u = − 2 v/(v
T v).
m×n has linearly independent columns. Hence A
T A has a (unique)
Cholesky factorization. Prove that there exists a factorization A = Q 1 R 1 where Q 1 ∈
m×n has columns forming an orthonormal set and R 1 ∈ R
n×n is an upper triangular
matrix. What is the solution of the least squares problem Ax ≈ b in terms of Q 1 , R 1 ,
and b?
∗ be a least squares solution to an overdetermined system Ax ≈ b. What is the
geometric interpretation of Ax
∗ ? When is Ax
∗ unique? When is x
∗ unique?
elements?
is orthogonal where A and C are square submatrices. Prove in a logical, deductive
fashion that B = 0. (Hint: there is no need to have a formula for the inverse of a 2 × 2
block upper triangular matrix, and there is no need to consider individual elements,
columns, or rows or A, B, or C.)
‖QA‖ 2 = ‖A‖ 2.
Qˆ q
T ρ
is an orthogonal matrix where Qˆ is square and ρ is a scalar. What can we say about
Qˆ, q, and ρ? (The answer should be simplified.)
pendent real vectors?
(b) How does this simplify if v 2 is orthogonal to v 1? In pariticular, what is the usual
way of expressing an orthogonal projector in this case?
3.2 QR Factorization
The least squares problem min x
‖b − Ax‖ 2 is simplified if A is reduced to upper triangular
form by means of orthogonal transformations:
T A = R right triangular
m×n has linearly independent columns. Hence A
T A has a (unique)
Cholesky factorization. Prove that there exists a factorization A = Q 1 R 1 where Q 1 ∈
m×n has columns forming an orthonormal set and R 1 ∈ R
n×n is an upper triangular
matrix. What is the solution of the least squares problem Ax ≈ b in terms of Q 1 , R 1 ,
and b?
3.3 Householder Reflections
Definition (Householder) An elementary matrix has the form
I + rank one matrix.
It is easy to show that an elementary matrix has the form
I + uv
T , u 6 = 0, v 6 = 0.
An example of an elementary matrix is a Gauss transformation Mk = I − mke
T k. An elemen-
tary matrix is efficient computationally; it is easy to invert. It is not difficult to show that
an orthogonal elementary matrix has the form
vv
T
v
T v
P is symmetric and P
2 = I. Exercise. Prove this.
Recall that
vv
T
v
T v
x is the orthogonal projection of x onto v.
T
T
What does P = I − 2
vv
T
v
T v
do?
hyperplane
orthogonal to v
T
T
T
T
x−2 x
vv
vv
x
vv
vv
It reflects in the hyperplane through the origin orthogonal to v. (How should one store P?
How should one multiply by P ?) In sum
T
T
Note that the length of v is irrelevant—only its direction matters.
In practice we want to determine v so that for some given x
P x =
α
0
.. .
for some α ∈ R.
reduction to triangular form
As in Gaussian elimination, we reduce A column by column.
Recursive description. The case m ≥ n = 1 is an exercise. Consider the case m ≥ n ≥ 2.
Determine orthogonal P such that
α a
T
P is to be constructed in the next section. Then
α a
T
and recursion gives A˜ = Q˜ R˜ so that
A = QR where Q = P
T
and R =
α a
T
Nonrecursive description. First, determine orthogonal P 1 such that
1
Similarly,
2
Then 1
1
4
P 4
3
P 3
2
P 2
R
Thus P 4 P 3 P 2 P 1 = Q
T , but we do not need to form this product. Rather we compute
T b = P 4 (P 3 (P 2 (P 1 b))).
Note. If m = n, then n − 1 reductions suffice.
Householder orthogonalization At beginning of the k
th stage
2n
k−
k−1,k−
22
11 12
We want to find P˜k = I − βk v˜k v˜
T k such that
k
k− 1 =
rkk rkk+1 · · · rkn
. A˜k
the algorithm
Householder orthogonalization
for k = 1, 2,... , n do {
determine a Householder reflection P˜k = I − βk ˜vk v˜
T k such that
k
akk
ak+1,k
. . .
amk
rkk
0
. . .
0
for j = k + 1, k + 2,... , n do
rkj
ak+1,j
. . .
amj
= P˜k
akj
ak+1,j
. . .
amj
Determine the least squares solution of Ax ≈ b where
b =
Do an efficient computation and show every step.
T v)
− 1 v
T such that P x is a multiple of y where
x 6 = 0 and y 6 = 0. Of the two possibilities, which uses for v the sum of two vectors
separated by an angle of at most π/2.
T k and^ vk
= [ 0 · · · 0 vkk · · ·^ vmk ]
T
. Only the following array values should be referenced
by your algorithm
bi, 1 ≤ i ≤ m,
vik, k ≤ i ≤ m, 1 ≤ k ≤ n,
βk, 1 ≤ k ≤ n.
Determine β 1 , β 2 , v 1 , v 2 and right triangular matrix R such that P 2 P 1 A = R where
Pi = I − βiviv
T i. (As a check confirm that^ A^ =^ P^1 P^2 R.)
T is orthogonal only
if u = − 2 v/(v
T v).
as described in this section.
vv
T
v
T v
the vector P x is the mirror
reflection of a vector x in the hyperplane through the origin normal to v. Let x and
y be linearly independent vectors of equal Euclidean length. By means of a pictorial
argument determine a formula for v such that P x = y.
Normalize the Householder vectors vk so that their first (nonzero) element is 1, as does
LAPACK, and calculate βk values. (Do not actually form the matrices Pk or worse yet
the matrix Qk.).
Pn · · · P 2 P 1 A = R
yields an upper triangular matrix R. This can be used to create a reduced QR factor-
ization A = Qˆ Rˆ where Qˆ is m by n and Rˆ is a square upper triangular matrix. What
is Rˆ in terms of P 1 , P 2 ,... , Pn, R? What is Qˆ in terms of P 1 , P 2 ,... , Pn, R?
| | / x | / | / | / | / | / | / | / |/ ---------------------------------------+--------------------------------------- | | | | | | | | | | |
Construct the vector x
′ def = −sign(x 1 )‖x‖ 2 e 1 on this graph. Also construct on the graph
a vector v in terms of x and x
′ such that P x = x
′ where P = I − 2
vv
T
vTv
2 2 where^ a, e^1 ∈^ R
n and e
T 1 = [1,^0 ,... ,^ 0].
without
changing the 1st and 3rd rows.
3.5 Gram-Schmidt Orthogonalization
Recall that if P is an orthogonal projector for a subspace S, then y − P y⊥S.
The classical Gram-Schmidt process produces an orthonormal set q 1 , q 2 ,... , qn from a
linearly independent set a 1 , a 2 ,... , an, and, in particular, q 1 , q 2 ,... , qk are formed from a 1 ,
a 2 ,... , ak, k = 1, 2 ,... , n:
a
v
q 1
2
2
q 1 = a 1 /‖a 1 ‖ 2 ,
v 2 = a 2 − q 1 q
T 1 a^2 ,
q 2 = v 2 /‖v 2 ‖ 2 ,
3
3
2
1
v
a
q
q
v 3 = a 3 − q 1 q
T 1 a^3 −^ q^2 q
T 2 a^3 ,
q 3 = v 3 /‖v 3 ‖ 2.
More generally,
vj = aj −
j− 1 ∑
k=
qkq
T k aj^ ,
qj = vj /‖vj ‖ 2.
Gram-Schmidt orthogonalization computes a reduced QR factorization:
aj =
j− 1 ∑
k=
qk (q
T k aj^ ) ︸ ︷︷ ︸ rkj
qj
j ∑
k=
qkrkj ,
so
a 1 a 2 · · · an
q 1 q 2 · · · qn
r 11 r 12 · · · r 1 n
r 22 · · · r 2 n
.. .
rnn
or
‖v 1 ‖ 2 q
T 1 a^2 q
T 1 a^3 · · ·
‖v 2 ‖ 2 q
T 2 a^3 · · ·
‖v 3 ‖ 2 · · ·
.. .
This is a reduced QR factorization.
The algorithm is
for k = 1, 2,... , n do {
vk = ak;
for j = 1, 2,... , k − 1 do {
rjk = q
T j ak;
vk = vk − qj rjk;
rkk = ‖vk‖ 2 ;
qk = vk/rkk;
}