Linear Algebra
Lecture 6.1 – 6.5
Woongsun Jeon
School of Electrical and Electronics Engineering
Chung Ang University
1
6.1 INNER PRODUCT,
LENGTH, AND
ORTHOGONALITY
2
1
INNER PRODUCT
βͺ
If u and v are vectors in βπ , then we regard u and v
as n ο΄1matrices.
βͺ
The transpose uT is a 1 × π matrix, and the matrix
product uTv is a 1 × 1 matrix, which we write as a
single real number (a scalar) without brackets.
βͺ
The number uTv is called the inner product of u
and v, and it is written as π’ β π£.
βͺ
The inner product is also referred to as a dot
product.
INNER PRODUCT
ο© u1 οΉ
ο© v1 οΉ
οͺu οΊ
οͺv οΊ
2
2
βͺ If u = οͺ οΊ and v = οͺ οΊ ,
οͺ οΊ
οͺ οΊ
οͺu οΊ
οͺv οΊ
ο« nο»
ο« nο»
then the inner product of u and v is
οu
1
u2
ο© v1 οΉ
οͺv οΊ
un ο οͺ 2 οΊ = u1v1 + u2v2 +
οͺ οΊ
οͺv οΊ
ο« nο»
+ unvn
2
INNER PRODUCT
βͺ
Theorem 1: Let u, v, and w be vectors in βπ , and
let c be a scalar. Then
a. π’ β π£ = π£ β π’
b. π’ + π£ β π€ = π’ β π€ + π£ β π€
c. ππ’ β π£ = π π’ β π£ = π’ β (ππ£)
d. π’ β π’ ≥ 0, and π’ β π’ = 0 if and only if u = 0
βͺ
Properties (b) and (c) can be combined several
times to produce the following useful rule
(π1 π’1 +…+ππ π’π ) β π€ = π1 π’1 β π€ + β― + ππ π’π β π€
THE LENGTH OF A VECTOR
βͺ If v is in βπ , with entries v1, …, vn, then the square
root of π£ β π£ is defined because π£ β π£ is nonnegative.
βͺ Definition: The length (or norm) of v is the
nonnegative scalar v defined by
π£ = π£βπ£ =
π£12 + π£22 + β― + π£π2 , and π£ 2 = π£ β π£
ο©a οΉ
ο«b ο»
βͺ Suppose v is in β2 , say, v = οͺ οΊ
3
THE LENGTH OF A VECTOR
βͺ A vector whose length is 1 is called a unit vector.
βͺ If we divide a nonzero vector v by its length—that is,
multiply by 1/ v .
βͺ The process of creating u from v is sometimes called
normalizing v, and we say that u is in the same
direction as v.
DISTANCE IN βπ
βͺ Definition: For u and v in βπ , the distance between u
and v, written as dist (u, v), is the length of the vector
u − v. That is,
dist (u,v) = u − v
4
DISTANCE IN βπ
βͺ Example 4: Compute the distance between the
vectors u = (7,1) and v = (3, 2) .
βͺ Solution: Calculate
ο© 7 οΉ ο© 3οΉ ο© 4 οΉ
u−v=οͺ οΊ−οͺ οΊ =οͺ οΊ
ο« 1ο» ο« 2 ο» ο« −1ο»
u − v = 42 + (−1) 2 = 17
DISTANCE IN βπ
βͺ Notice that the parallelogram in the above figure
shows that the distance from u to v is the same as the
distance from u − v to 0.
5
ORTHOGONAL VECTORS
βͺ Consider β2 or β3 and two lines through the origin
determined by vectors u and v.
βͺ The two lines shown in the figure are geometrically
perpendicular if and only if the distance from u to v is
the same as the distance from u to − v.
βͺ This is the same as requiring the squares of the
distances to be the same.
ORTHOGONAL VECTORS
βͺ Now
[dist u, −v ]2 = u − (−v) 2 = u + v 2
= u+v β u+v
= u β u + v + v β u + v Theorem 1(b)
= u β u + u β v + v β u + v β v Theorem 1(a), (b)
= u 2 + v 2 + 2u β v Theorem 1(a)
βͺ The same calculations with v and − v interchanged show
that
[dist u, v ]2 = u 2 + −v 2 + 2u β (−v)
= u 2 + v 2 − 2u β v
βͺ The two squared distances are equal if and only if
2π’ β π£ = −2π’ β π£, which happens if and only if π’ β π£ = 0.
6
ORTHOGONAL VECTORS
βͺ Definition: Two vectors u and v in βπ are orthogonal (to
each other) if π’ β π£ = 0.
βͺ The zero vector is orthogonal to every vector in βπ
because 0T v = 0 for all v.
βͺ Theorem 2: Two vectors u and v are orthogonal if and
only if
u+v = u + v
2
2
2
THE PYTHOGOREAN THEOREM
Orthogonal Complements
βͺ If a vector z is orthogonal to every vector in a subspace
W of βπ , then z is said to be orthogonal to W.
βͺ The set of all vectors z that are orthogonal to W is
called the orthogonal complement of W and is
denoted by W ⊥ (and read as “W perpendicular” or
simply “W perp”).
⊥
1. A vector x is in W if and only if x is orthogonal
to every vector in a set that spans W.
⊥
2. W is a subspace of βπ .
7
ORTHOGONAL COMPLEMENTS
βͺ
Theorem 3: Let A be an m ο΄ n matrix. The orthogonal
complement of the row space of A is the null space
of A, and the orthogonal complement of the column
space of A is the null space of AT:
(Row A) ⊥ = Nul A and (Col A) ⊥ = Nul AT
ORTHOGONAL COMPLEMENTS
βͺ Proof: The row-column rule for computing Ax shows that
if x is in Nul A, then x is orthogonal to each row of A (with
the rows treated as vectors in βπ ).
βͺ Since the rows of A span the row space, x is orthogonal to
Row A.
βͺ Conversely, if x is orthogonal to Row A, then x is certainly
orthogonal to each row of A, and hence Ax = 0 .
βͺ This proves the first statement of the theorem.
8
ORTHOGONAL COMPLEMENTS
βͺ Since this statement is true for any matrix, it is true
for AT.
βͺ That is, the orthogonal complement of the row space
of AT is the null space of AT.
βͺ This proves the second statement, because
Row AT = Col A
ANGLES IN β2 AND β3 (OPTIONAL)
βͺ If u and v are nonzero vectors in either β2 or β3 ,
then there is a nice connection between their inner
product and the angle ο between the two line
segments from the origin to the points identified with
u and v.
βͺ The formula is
π’u
β π£v = u v cos ο
9
ANGLES IN β2 AND β3 (OPTIONAL)
βͺ By the law of cosines,
u − v = u + v − 2 u v cos ο
2
2
2
6.2 ORTHOGONAL
SETS
20
10
ORTHOGONAL SETS
βͺ A set of vectors {u1,…,up} in βπ is said to be an
orthogonal set if each pair of distinct vectors from
the set is orthogonal, that is,
if π’π β π’π = 0 whenever i οΉ j
βͺ Theorem 4: If S = {u1 , ,u p } is an orthogonal set of
nonzero vectors in βπ , then S is linearly independent
and hence is a basis for the subspace spanned by S.
ORTHOGONAL SETS
βͺ Proof: If 0 = c1u1 + + c p u p for some scalars c1,…,cp,
then
0 = 0 βuu11= (c1u1 + c2 u 2 + + c p u p ) βuu11
= (c1u1 ) βuu11+ (c2 u 2 ) βuu11+
+ (c p u p ) βuu11
= c1 (u1 βuu11) + c2 (u 2 βuu11))+
+ c p (u p βuu11))
= c1 (u1 βuu11))
because u1 is orthogonal to u2,…,up.
βͺ Since u1 is nonzero, u1 β u1 is not zero and so c1 = 0
βͺ Similarly, c2,…,cp must be zero.
βͺ Thus S is linearly independent.
11
ORTHOGONAL SETS
βͺ Definition: An orthogonal basis for a subspace W of βπ
is a basis for W that is also an orthogonal set.
βͺ Theorem 5: Let {u1,…,up} be an orthogonal basis for a
subspace W of βπ . For each y in W, the weights in the
linear combination
y = c1u1 + + c p u p
are given by
ππ =
π¦ β uπ
uπ β uπ
( j = 1,
, p)
AN ORTHOGONAL PROJECTION
βͺ Given a nonzero vector u in βπ , consider the problem
of decomposing a vector y in βπ into the sum of two
vectors, one a multiple of u and the other orthogonal
to u. We wish to write
y = yˆ + z
where yΜ = ο‘ u for some scalar α and z is some vector
orthogonal to u.
βͺ The vector yΜ is called the orthogonal projection of y
onto u, and the vector z is called the component of y
orthogonal to u.
12
AN ORTHOGONAL PROJECTION
βͺ If c is any nonzero scalar and if u is replaced by cu in
the definition of yΜ, then the orthogonal projection of
y onto cu is exactly the same as the orthogonal
projection of y onto u.
βͺ Hence this projection is determined by the subspace L
spanned by u (the line through u and 0).
βͺ Sometimes yΜ is denoted by projLy and is called the
orthogonal projection of y onto L.
βͺ That is,
yyβ u
yΜ = projL y =
uuβ u
u
AN ORTHOGONAL PROJECTION
ο©7 οΉ
ο«6ο»
ο©4οΉ
ο«2ο»
βͺ Example 3: Let y = οͺ οΊ and u = οͺ οΊ .
βͺ Find the orthogonal projection of y onto u.
Then write y as the sum of two orthogonal vectors,
one in Span{u} and one orthogonal to u.
βͺ Solution: Compute
7 4
β
= 40
6 2
4 4
uβu=
β
= 20
2 2
yβu=
13
AN ORTHOGONAL PROJECTION
βͺ The orthogonal projection of y onto u is
yΜ =
ο© 4 οΉ ο© 8οΉ
40
π¦yβ u
π’
u = u = 2οͺ οΊ = οͺ οΊ
π’uβ uπ’
20
ο«2ο» ο« 4ο»
and the component of y orthogonal to u is
ο©7 οΉ ο© 8οΉ ο© −1οΉ
y − yˆ = οͺ οΊ − οͺ οΊ = οͺ οΊ
ο« 6ο» ο« 4ο» ο« 2ο»
AN ORTHOGONAL PROJECTION
βͺ The sum of these two vectors is y.
ο©7 οΉ ο© 8οΉ ο© −1οΉ
οͺ 6οΊ = οͺ 4οΊ + οͺ 2οΊ
ο« ο» ο« ο» ο« ο»
y
yΜ
ˆ
(y − y)
βͺ The decomposition of y is illustrated in the following
figure:
14
ORTHONORMAL SETS
βͺ A set {u1,…,up} is an orthonormal set if it is an
orthogonal set of unit vectors.
βͺ If W is the subspace spanned by such a set, then
{u1,…,up} is an orthonormal basis for W, since the set is
automatically linearly independent, by Theorem 4.
βͺ The simplest example of an orthonormal set is the
standard basis {e1,…,en} for βπ .
βͺ Any nonempty subset of {e1,…,en} is orthonormal, too.
ORTHONORMAL SETS
βͺ Example 2: Show that {v1, v2, v3} is an orthonormal
basis of β3 , where
ο© −1/
ο©3 / 11 οΉ
οͺ
οͺ
οΊ
v1 = οͺ1/ 11,οΊ v 2 = οͺ 2 /
οͺ
οΊ
οͺ
1/
11
οͺο«
οΊο»
οͺο« 1/
ο© −1/ 66 οΉ
6οΉ
οΊ
οͺ
οΊ
,6 οΊ v = οͺ −4 / 66 οΊ
3
οͺ
οΊ
οΊ
7
/
66
6 οΊο»
οͺο«
οΊο»
15
ORTHONORMAL SETS
βͺ Solution: Compute
vv11 β vv22 = −3 / 66 + 2 / 66 + 1/ 66 = 0
vv11 β vv33 = −3 / 726 − 4 / 726 + 7 / 726 = 0
vv2 2β vv33 = 1/ 396 − 8 / 396 + 7 / 396 = 0
βͺ Thus {v1, v2, v3} is an orthogonal set.
ORTHONORMAL SETS
βͺ Also,
vv
v11 = 9 /11 + 1/11 + 1/11 = 01
1 1β v
vv22 β v22 = 1/ 6 + 4 / 6 + 1/ 6 = 1
vv33β v33 = 1/ 66 + 16 / 66 + 49 / 66 = 1
which shows that v1, v2, and v3 are unit vectors.
βͺ Thus {v1, v2, v3} is an orthonormal set.
βͺ Since the set is linearly independent, its three vectors
form a basis for β3 .
16
ORTHONORMAL SETS
βͺ When the vectors in an orthogonal set of nonzero
vectors are normalized to have unit length, the new
vectors will still be orthogonal, and hence the new set
will be an orthonormal set.
ORTHONORMAL SETS
βͺ Theorem 6: An m ο΄ n matrix U has orthonormal columns
if and only if
T
U U =I
βͺ Proof: To simplify notation, we suppose that U has only
three columns, each a vector in βπ .
βͺ Let U = ο u1 u 2 u 3 ο and compute
ο© u1T οΉ
οͺ οΊ
U TU = οͺ u T2 οΊ ο u1
οͺο« u T3 οΊο»
u2
ο© u1T u1 u1T u 2
οͺ
u 3 ο = οͺ u T2 u1 u T2 u 2
οͺο« u T3 u1 u T3 u 2
u1T u 3 οΉ
οΊ
u T2 u 3 οΊ
u T3 u 3 οΊο»
17
ORTHONORMAL SETS
βͺ The entries in the matrix at the right are inner
products, using transpose notation.
βͺ The columns of U are orthogonal if and only if
u1T u 2 = u T2 u1 = 0 u1T u 3 = u T3 u1 = 0 u T2 u 3 = u T3 u 2 = 0
βͺ The columns of U all have unit length if and only if
u1T u1 = 1
u T2 u 2 = 1
u T3 u 3 = 1
ORTHONORMAL SETS
βͺ
Theorem 7: Let U be an m ο΄ n matrix with
orthonormal columns, and let x and y be in βπ .
Then
Ux = x
ππ₯ β ππ¦ = π₯ β π¦
ππ₯ β ππ¦ =0 if and only if π₯ β π¦=0
βͺ
Properties say that the linear x Ux mapping
preserves lengths and orthogonality.
18
6.3 ORTHOGONAL
PROJECTIONS
37
ORTHOGONAL PROJECTIONS
βͺ The orthogonal projection of a point in β2 onto a line
through the origin has an important analogue in βπ .
βͺ Given a vector y and a subspace W in βπ , there is a
vector yΜ in W such that (1) yΜ is the unique vector in W
ˆ is orthogonal to W, and (2) yΜ is the
for which y − y
unique vector in W closest to y.
19
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ These two properties of yΜ provide the key to finding
the least-squares solutions of linear systems.
βͺ Theorem 8: Let W be a subspace of βπ . Then each y
in βπ can be written uniquely in the form
y = yˆ + z
where yΜ is in W and z is in W ⊥.
(1)
βͺ In fact, if {u1,…,up} is any orthogonal basis of W, then
yΜ =
π¦yβ π’
u11
π’u11 β uπ’11
u1 +
+
π¦y β uπ’pπ
π’
uπp βuπ’pπ
up
(2)
and z = y − yˆ .
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ The vector yΜ is called the orthogonal projection of y
onto W and often is written as projWy.
βͺ Proof: Let {u1,…,up} be any orthogonal basis for W,
and define yΜ by (2).
βͺ Then yΜ is in W because yΜ is a linear combination of
the basis u1,…,up.
20
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ Let z = y − yˆ .
βͺ Since u1 is orthogonal to u2,…,up, it follows from (2)
that
yβu
1
z β u1 = y − yΰ· β u1 = y β u1 −
u1 β u1 − 0…0-0
u1 βu1
= y β u1 − y β u1 = 0
βͺ Thus z is orthogonal to u1.
βͺ Similarly, z is orthogonal to each uj in the basis for W.
βͺ Hence z is orthogonal to every vector in W.
βͺ That is, z is in W ⊥.
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ Example 1: Let
ο© 2οΉ
ο© −2 οΉ
ο© 1οΉ
u1 = οͺ 5οΊ ,u 2 = οͺ 1οΊ ,and y = οͺ 2 οΊ
οͺ οΊ
οͺ οΊ
οͺ οΊ
οͺο« −1οΊο»
οͺο« 1οΊο»
οͺο« 3οΊο»
Observe that {u1, u2} is an orthogonal basis for
W = Span{u1 ,u 2 } . Write y as the sum of a vector in W
and a vector orthogonal to W.
21
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ Solution: The orthogonal projection of y onto W is
yΜ =
π¦y β u
π’11
π’π’u111 ββ u
π’π’111
u1 +
π¦yβ u
π’22
π’u22 β u
π’22
u2
ο© 2οΉ
ο© −2 οΉ
ο© 2οΉ
ο© −2 οΉ ο© −2 / 5οΉ
9 οͺ οΊ 3 οͺ οΊ 9 οͺ οΊ 15 οͺ οΊ οͺ
=
5 +
1 =
5 +
1 =
2οΊ
οΊ
30 οͺ οΊ 6 οͺ οΊ 30 οͺ οΊ 30 οͺ οΊ οͺ
οͺο« −1οΊο»
οͺο« 1οΊο»
οͺο« −1οΊο»
οͺο« 1οΊο» οͺο« 1/ 5οΊο»
βͺ Also
ο© 1οΉ ο© −2 / 5οΉ ο© 7 / 5οΉ
y − yˆ = οͺ 2 οΊ − οͺ
2οΊ = οͺ
0οΊ
οͺ οΊ οͺ
οΊ οͺ
οΊ
οͺο« 3οΊο» οͺο« 1/ 5οΊο» οͺο«14 / 5οΊο»
THE ORTHOGONAL DECOMPOSITION
THEOREM
βͺ Theorem 8 ensures that y − yˆ is in W .⊥
βͺ To check the calculations, verify that y − yˆ is
orthogonal to both u1 and u2 and hence to all of W.
βͺ The desired decomposition of y is
ο© 1οΉ ο© −2 / 5οΉ ο© 7 / 5οΉ
y = οͺ2οΊ = οͺ
2οΊ + οͺ
0οΊ
οͺ οΊ οͺ
οΊ οͺ
οΊ
οͺο« 3οΊο» οͺο« 1/ 5οΊο» οͺο«14 / 5οΊο»
22
PROPERTIES OF ORTHOGONAL
PROJECTIONS
βͺ If {u1,…,up} is an orthogonal basis for W and if y
happens to be in W, then the formula for projWy is
exactly the same as the representation of y given in
Theorem 5 in Section 6.2.
βͺ In this case, projW y = y
βͺ If y is in W = Span{u1 , ,u p } , then projW y = y .
THE BEST APPROXIMATION THEOREM
βͺ Theorem 9: Let W be a subspace of βπ , let y be any
vector in βπ , and let yΜ be the orthogonal projection of y
onto W. Then yΜ is the closest point in W to y, in the
sense that
y − yˆ οΌ y − v
(3)
for all v in W distinct from yΜ.
βͺ The vector yΜ in Theorem 9 is called the best
approximation to y by elements of W.
βͺ The distance from y to v, given by y − v , can be
regarded as the “error” of using v in place of y.
βͺ Theorem 9 says that this error is minimized when v = yˆ .
23
PROPERTIES OF ORTHOGONAL
PROJECTIONS
βͺ Example 4:The distance from a point y in βπ to a
subspace W is defined as the distance from y to the
nearest point in W. Find the distance from y to
W = Span{u1 , u 2 } , where
ο© −1οΉ
ο© 5οΉ
ο© 1οΉ
y = οͺ −5οΊ , u1 = οͺ −2 οΊ , u 2 = οͺ 2 οΊ
οͺ οΊ
οͺ οΊ
οͺ οΊ
οͺο« 10 οΊο»
οͺο« 1οΊο»
οͺο« −1οΊο»
βͺ Solution: By the Best Approximation Theorem, the
distance from y to W is y − yˆ , where yΜ = projW y
PROPERTIES OF ORTHOGONAL
PROJECTIONS
βͺ Since {u1, u2} is an orthogonal basis for W,
ο© 5οΉ
ο© 1οΉ ο© −1οΉ
15
−21
1
7
yΜ = u1 +
u 2 = οͺ −2 οΊ − οͺ 2 οΊ = οͺ −8οΊ
30
6
2οͺ οΊ 2οͺ οΊ οͺ οΊ
οͺο« 1οΊο»
οͺο« −1οΊο» οͺο« 4 οΊο»
ο© −1οΉ ο© −1οΉ ο©0 οΉ
y − yˆ = οͺ −5οΊ − οͺ −8οΊ = οͺ 3οΊ
οͺ οΊ οͺ οΊ οͺ οΊ
οͺο« 10 οΊο» οͺο« 4 οΊο» οͺο«6 οΊο»
y − yˆ = 32 + 62 = 45
2
βͺ The distance from y to W is 45 = 3 5 .
24
PROPERTIES OF ORTHOGONAL
PROJECTIONS
βͺ Theorem 10: If {u1,…,up} is an orthonormal basis for a
subspace W of βπ , then
projπ π¦ = y β u1 u1 + y β u2 u2 + β― + y β up up (4)
If
U = ο©ο« u1
for all y in βπ
u2
u p οΉο» , then
projW y = UU T y
(5)
6.4 THE GRAMSCHMIDT PROCESS
50
25
THE GRAM-SCHMIDT PROCESS
51
THE GRAM-SCHMIDT PROCESS
52
26
THE GRAM-SCHMIDT PROCESS
βͺ Theorem 11: The Gram-Schmidt Process
βͺ Given a basis {x1, . . . , xp} for a nonzero subspace W of βπ ,
define
v1 = x1
π± βπ―
v2 = x2 − 2 1 v1
v3 = x3 −
.
.
.
π―1 βπ―1
π±3βπ―1
π―1 βπ―1
π± βπ―
v1 − 3 2 v2
π―2 βπ―2
π± βπ―
π± βπ―
π―1 βπ―1
π―2 βπ―2
vπ = xπ − π 1 v1 − π 2 v2− . . . −
π±πβπ―π−1
v
π―π−1 βπ―π−1 p–1
βͺ Then {v1 , . . . , vp} is an orthogonal basis for W. In addition
(1)
Span{v1 , . . . , vk} = Span{x1 , . . . , xk} for 1 ≤ π ≤ π.
THE GRAM-SCHMIDT PROCESS
βͺ Proof For 1 ≤ π ≤ π, let Wk = Span{x1 , . . . , xk}. Set v1 = x1, so
that Span{v1} = Span {x1}. Suppose for some k < p, we have
constructed v1, . . . , vk so that {v1 , . . . , vk} is an orthogonal basis
for Wk. Define
vk+1 = xk+1 – projWkxk+1
(2)
βͺ By the Orthogonal Decomposition Theorem, vk+1 is orthogonal to
Wk. Furthermore, vk+1 ≠ 0 because xk+1 is not in
Wk = Span{x1 , . . . , xk}
βͺ Hence {v1 , . . . , vk} is an orthogonal set of nonzero vectors in the
(k + 1)-dimensional space Wk+1. By the Basis Theorem in Section
4.5, this set is an orthogonal basis for Wk+1. Hence Wk+1 = Span{v1
, . . . , vk+1}. When k + 1 = p, the process stops.
27
ORTHONORMAL BASES
βͺ Example 3 Example 1 constructed the orthogonal basis
3
0
v1 = 6 , v2 = 0
0
2
βͺ An orthonormal basis is
3 1/ 5
1
1
u1 =
v1 =
6 = 2/ 5
v1
45
0
0
0
1
u2 =
v = 0
v2 2
1
QR FACTORIZATION OF MATRICES
βͺ Theorem 12: The QR Factorization
βͺ If A is an m × n matrix with linearly independent columns,
then A can be factored as A = QR, where Q is an m × n
matrix whose columns form an orthonormal basis for Col
A and R is an n × n upper triangular invertible matrix with
positive entries on its diagonal.
28
QR FACTORIZATION OF MATRICES
1 0 0
βͺ Example 4 Find a QR factorization of A = 1 1 0 .
1 1 1
1 1 1
βͺ Solution The columns of A are the vectors x1, x2, and x3 in
Example 2. An orthogonal basis for
Col A
= Span{x1, x2, x3} was found in that example:
0
1
−3
−2/3
1
1
π―1 =
, π―2 =
, π―3 =
1/3
1
1
1/3
1
1
QR FACTORIZATION OF MATRICES
βͺ To simplify the arithmetic that follows, scale v3 by replacing
v3 by 3v3. Then normalize the three vectors to obtain u1, u2,
and u3, and use these vectors as the columns of Q:
1/2 −3/ 12
0
1/2 1/ 12 −2/ 6
Q=
.
1/2 1/ 12
1/ 6
1/2 1/ 12
1/ 6
βͺ By construction, the first k columns of Q are an
orthonormal basis of Span{x1 , . . . , xk}.
29
QR FACTORIZATION OF MATRICES
βͺ From the proof of Theorem 12, A = QR for some R. To find
R, observe that QTQ = I, because the columns of Q are
orthonormal. Hence
πππ΄ = ππ ππ
= πΌπ
= π
βͺ and
1/2
1/2
1/2
R = −3/ 12 1/ 12 1/ 12
0
−2/ 6 1/ 12
1/2
1/ 12
1/ 6
1
1
1
1
0
1
1
1
0
0
1
1
2
3/2
1
= 0 3/ 12 2/ 12
0
0
3/ 12
6.5 LEASTSQUARES
PROBLEMS
60
30
LEAST-SQUARES PROBLEMS
βͺ Definition: If A is m ο΄ n and b is in βπ , a least-squares solution
of Ax = b is an xΜ in βπ such that
π
b − Axˆ ο£ b − Ax
for all x in β .
βͺ The most important aspect of the least-squares problem is that
no matter what x we select, the vector Ax will necessarily be in
the column space, Col A.
βͺ So we seek an x that makes Ax the closest point in Col A to b.
LEAST-SQUARES PROBLEMS
βͺ Solution of the General Least-Squares Problem
βͺ Given A and b, apply the Best Approximation Theorem to the
subspace Col A.
βͺ Let
bΜ = proj b
Col A
βͺ Because bΜ is in the column space A, the equation Ax = bˆ is
consistent, and there is an xΜ in βπ such that
AxΜ = bˆ
(1)
βͺ Since bΜ is the closest point in Col A to b, a vector xΜ is a leastsquares solution of Ax = b if and only if xΜ satisfies (1).
31
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Suppose xΜ satisfies AxΜ = bˆ
βͺ By the Orthogonal Decomposition Theorem, the projection bΜ
has the property that b − Axˆ is orthogonal to Col A, so b − bˆ
is orthogonal to each column of A.
βͺ If aj is any column of A, then ππ β π − π΄π₯ΰ· = 0, and
πππ π − π΄π₯ΰ· = 0.
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Since each a Tj is a row of AT,
ˆ =0
AT (b − Ax)
βͺ Thus
(2)
AT b − AT Axˆ = 0
AT AxΜ = AT b
βͺ These calculations show that each least-squares solution of Ax = b
satisfies the equation
AT Ax = AT b (3)
βͺ The matrix equation (3) represents a system of equations
called the normal equations for Ax = b .
βͺ A solution of (3) is often denoted by xΜ .
32
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Theorem 13: The set of least-squares solutions of Ax = b coincides
with the nonempty set of solutions of the normal equation
AT Ax = AT b
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Example 1: Find a least-squares solution of the system Ax = b
for
ο©4 0οΉ
ο© 2οΉ
A = οͺ0 2οΊ , b = οͺ 0οΊ
οͺ
οΊ
οͺ οΊ
οͺο« 1 1οΊο»
οͺο«11οΊο»
33
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Solution: To use normal equations (3), compute:
ο©4 0οΉ
ο© 4 0 1οΉ οͺ
οΊ = ο©17 1οΉ
A A=οͺ
0
2
οΊ
οͺ
οΊ
ο« 0 2 1ο» οͺ 1 1οΊ ο« 1 5ο»
οͺο«
οΊο»
ο© 2οΉ
ο© 4 0 1οΉ οͺ οΊ ο©19 οΉ
T
A b=οͺ
οΊ 0 =οͺ οΊ
ο« 0 2 1ο» οͺ11οΊ ο«11ο»
οͺο« οΊο»
T
βͺ Then the equation AT Ax = AT b becomes
ο©17 1οΉ ο© x1 οΉ ο©19 οΉ
οͺ 1 5οΊ οͺ x οΊ = οͺ11οΊ
ο«
ο»ο« 2ο» ο« ο»
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ Row operations can be used to solve the system on the previous
slide, but since ATA is invertible and 2 ο΄ 2, it is probably faster to
compute
( AT A) −1 =
1 ο© 5 −1οΉ
84 οͺο« −1 17 οΊο»
and then solve AT Ax = AT b as
xΜ = ( AT A) −1 AT b
=
1 ο© 5 −1οΉ ο©19 οΉ 1 ο© 84 οΉ ο© 1οΉ
=
=
84 οͺο« −1 17 οΊο» οͺο«11οΊο» 84 οͺο«168οΊο» οͺο« 2 οΊο»
34
SOLUTION OF THE GENREAL LEASTSQUARES PROBLEM
βͺ
Theorem 14: Let A be an m ο΄ n matrix. The following
statements are logically equivalent:
a. The equation Ax = b has a unique least-squares solution
for each b in βπ .
b. The columns of A are linearly independent.
c. The matrix ATA is invertible.
When these statements are true, the least-squares solution xΜ is given by
(4)
T
−1 T
xΜ = ( A A) A b
βͺ
When a least-squares solution xΜ is used to produce AxΜ as an
approximation to b, the distance from b to AxΜ is called the
least-squares error of this approximation.
ALTERNATIVE CALCULATIONS OF
LEAST-SQUARES SOLUTIONS
βͺ Theorem 15: Given an m ο΄ n matrix A with linearly independent
columns, let A = QR be a QR factorization of A. Then, for each b in
βπ , the equation Ax = b has a unique least-squares solution,
given by
xΜ = R −1QT b
35
Question?
71
36
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )