Professional Documents
Culture Documents
John Leth
jjl@es.aau.dk
Department of Electronic Systems,
Aalborg University,
Denmark
Agenda
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
Example Projectors
Complementary projectors Example
Complementary projectors
Orthogonal projectors Orthogonal projectors
The SVD and EVD of an orthogonal projectors The SVD and EVD of an
orthogonal projectors
Construction of an orthogonal projector
Construction of an
orthogonal projector
QR Factorization
QR Factorization
The full QR factorization
The full QR factorization Example of how to use the
Example of how to use the QR factorization QR factorization
Gram-Schmidt
Orthogonalization
Gram-Schmidt Orthogonalization Modified Gram-Schmidt
Cholesky Factorization
Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
John Leth
Definition 3 Projectors
A projector (or projection matrix) is an idempotent matrix P, that is, Example
Complementary projectors
P2 = P
Orthogonal projectors
(hence P is square) The SVD and EVD of an
orthogonal projectors
Construction of an
orthogonal projector
QR Factorization
The full QR factorization
Example of how to use the
QR factorization
Gram-Schmidt
Orthogonalization
Modified Gram-Schmidt
Operation count
A remark
Cholesky Factorization
Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
4 Example
Complementary projectors
Cholesky Factorization
Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
John Leth
hence I − P is also a projector, called the complementary projector. The SVD and EVD of an
orthogonal projectors
The word “complementary” comes from the facts that Construction of an
orthogonal projector
1 range(P) = null(I − P) QR Factorization
2 range(I − P) = null(P) The full QR factorization
Example of how to use the
3 null(P) ∩ range(P) = range(I − P) ∩ range(P) = {0} QR factorization
Gram-Schmidt
Which implies that Orthogonalization
Modified Gram-Schmidt
Any vector x can be written uniquely as: Operation count
x = x1 + x2 with x1 ∈ range(P) and x2 ∈ range(I − P) A remark
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
Example
Complementary projectors
6 Orthogonal projectors
Definition The SVD and EVD of an
A projector P which is also hermitian (P = P∗) is called an orthogonal orthogonal projectors
Construction of an
projector. orthogonal projector
The word “orthogonal” comes from the fact that range(I − P) and range(P) QR Factorization
The full QR factorization
are orthogonal:
Example of how to use the
QR factorization
∗ def ∗ ∗ ∗ 2
u v = ((I − P)x ) Pz = x (I − P)Pz = x (P − P )z = 0 Gram-Schmidt
Orthogonalization
Modified Gram-Schmidt
That is, if we write x = x1 + x2 with x1 ∈ range(P) and x2 ∈ range(I − P), Operation count
then x1 ⊥x2 . A remark
Cholesky Factorization
Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
Let P be an m × m projector, and assume that range(I − P) and range(P) are
John Leth
orthogonal.
Let {q1 , . . . , qm } be any orthonormal basis for Cm such that Projectors
Example
Complementary projectors
span{q1 , . . . , qn } = range(P) Orthogonal projectors
QR Factorization
h i
I 0 def The full QR factorization
PQ = [q1 · · · qn 0 · · · 0] ⇒ Q PQ = n
∗
= Σ. Example of how to use the
0 0 QR factorization
Gram-Schmidt
That is we have constructed an SVD (and EVD) of P: Orthogonalization
Modified Gram-Schmidt
h i
I 0 Operation count
P = QΣQ , ∗
Σ= n , Q = [q1 · · · qm ]. A remark
0 0
Cholesky Factorization
Existence and uniqueness
Which also show that P is an orthogonal projector, and that it has a particular
nice reduced SVD
P = Q̂ Q̂ ∗ , Q̂ = [q1 · · · qn ].
Matrix Computations:
Let {a1 , . . . , an } be a set of linear independent vectors in Cm . Theory and Numerical
Methods
John Leth
Construct an orthogonal projector P onto the subspace span{a1 , . . . , an }.
Projectors
Let A = [a1 · · · an ] then the above may be stated equivalently as Example
Complementary projectors
Construct an orthogonal projector P onto the subspace range(A). Orthogonal projectors
The SVD and EVD of an
Let b be any vector and y its orthogonal projection onto range(A) (that is orthogonal projectors
8 Construction of an
y = Pb), then orthogonal projector
QR Factorization
ai∗ (b − y ) = 0 for i = 1, . . . , n The full QR factorization
Example of how to use the
QR factorization
Gram-Schmidt
Orthogonalization
Modified Gram-Schmidt
Operation count
A remark
Cholesky Factorization
Existence and uniqueness
Matrix Computations:
Theory and Numerical
Let {a1 , . . . , an } be a set of linear independent vectors in Cm . Methods
John Leth
Construct an orthogonal projector P onto the subspace span{a1 , . . . , an }.
Projectors
Let A = [a1 · · · an ] then the above may be stated equivalently as Example
Complementary projectors
Construct an orthogonal projector P onto the subspace range(A). Orthogonal projectors
The SVD and EVD of an
orthogonal projectors
Let b be any vector and y its orthogonal projection onto range(A) (that is 8 Construction of an
y = Pb), then orthogonal projector
QR Factorization
ai∗ (b − y ) = 0 for i = 1, . . . , n The full QR factorization
Example of how to use the
QR factorization
or compactly written
Gram-Schmidt
Orthogonalization
∗ def ∗ ∗ ∗
0 = A (b − y ) = A (b − Ax ) = A b − A Ax . Modified Gram-Schmidt
Operation count
A remark
Hence
Cholesky Factorization
Matrix Computations:
Theory and Numerical
Let A = [a1 · · · an ] be an m × n matrix (m ≥ n) with full rank n, and consider Methods
the subspaces John Leth
Projectors
span{a1 } ⊂ span{a1 , a2 } ⊂ · · · span{a1 , . . . , an }
Example
Complementary projectors
The idea of QR factorization is the construction of a sequence of orthonormal Orthogonal projectors
vectors q1 , q2 , . . . , qn such that The SVD and EVD of an
orthogonal projectors
Construction of an
span{q1 , . . . , qi } = span{a1 , . . . , ai } for all i = 1, . . . , n. orthogonal projector
9 QR Factorization
This yields the following relation (the reduced QR factorization of A) The full QR factorization
Example of how to use the
QR factorization
A = Q̂ R̂
Gram-Schmidt
Orthogonalization
with Q̂ an m × n matrix with orthonormal columns and R̂ and n × n Modified Gram-Schmidt
Operation count
upper-triangular matrix;
A remark
Cholesky Factorization
r11 r12 ··· r1n
Existence and uniqueness
.. ..
r22 . .
Q̂ = [q1 · · · qn ], R̂ = rii ̸= 0
.. ..
.
.
rnn
Dept. of Electronic Systems,
Aalborg University,
18 Denmark
QR Factorization
The full QR factorization
Matrix Computations:
Theory and Numerical
Methods
A = QR Complementary projectors
Orthogonal projectors
The SVD and EVD of an
where orthogonal projectors
Construction of an
▶ Q ∈ Cm×m is unitary. orthogonal projector
Gram-Schmidt
Theorem Orthogonalization
Let A ∈ Cm×n (m ≥ n). Modified Gram-Schmidt
Operation count
▶ A has a QR factorization A remark
▶ If A has full rank then it has a unique reduced QR factorization, with R Cholesky Factorization
having positive diagonal entries. Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
Example
For given A ∈ Cm×n and b ∈ Cm solve for x : Complementary projectors
Orthogonal projectors
b = Ax . The SVD and EVD of an
orthogonal projectors
Construction of an
Note that Q ∗ b = Rx with A = QR. orthogonal projector
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
The QR Algorithm is one of the jewels of numerical analysis Example
Complementary projectors
Orthogonal projectors
The SVD and EVD of an
orthogonal projectors
Construction of an
orthogonal projector
QR Factorization
The full QR factorization
12 Example of how to use the
QR factorization
Gram-Schmidt
Orthogonalization
Modified Gram-Schmidt
Operation count
A remark
Cholesky Factorization
Under suitable conditions (see Lecture 28) the QR Algorithm will converge to Existence and uniqueness
Matrix Computations:
Theory and Numerical
For a given m × n matrix A = [a1 . . . an ] with QR factorization A = QR, one Methods
John Leth
may find the columns qi of Q = [q1 · · · qn ] and the entries rij of R = [rij ] by
means of the classical Gram-Schmidt iteration Projectors
Example
Complementary projectors
Orthogonal projectors
The SVD and EVD of an
Construction of Q = [q1 · · · qn ] orthogonal projectors
Construction of an
orthogonal projector
For i =1 to n
QR Factorization
∗
vi = ai − (q1∗ ai )q1 − · · · − (qi−1 ai )qi−1 The full QR factorization
Example of how to use the
= ai − (q1 q1∗ )ai − · · · − (qi−1 qi−1
∗
)ai QR factorization
13 Gram-Schmidt
qi = vi /||vi ||2 Orthogonalization
Modified Gram-Schmidt
Construction of R = [rij ] Operation count
A remark
qi∗ aj i≠ j, Cholesky Factorization
rij = Existence and uniqueness
||vi ||2 i = j.
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
The classical Gram-Schmidt iteration can be written on matrix form as: Example
Complementary projectors
P1 = I, QR Factorization
The full QR factorization
∗
Pi = I − Q̂i−1 Q̂i−1 , Q̂i−1 = [q1 · · · , qi−1 ], i ≥ 2. Example of how to use the
QR factorization
Gram-Schmidt
The modified Gram-Schmidt iteration computes each Pi by a sequence of Orthogonalization
i − 1 projections of rank m − 1: 14 Modified Gram-Schmidt
Operation count
∗
Pi = (I − qi−1 qi−1 ) · · · (I − q1 q1∗ ) = P⊥qi−1 · · · P⊥q1 , A remark
Cholesky Factorization
with (I − qq ∗ ) the orthogonal projection onto the subspace orthogonal to q. Existence and uniqueness
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
Example
Complementary projectors
Orthogonal projectors
The SVD and EVD of an
orthogonal projectors
Construction of an
orthogonal projector
Figure: Algorithm for reduced QR factorization
QR Factorization
The full QR factorization
Example of how to use the
Theorem QR factorization
Matrix Computations:
Theory and Numerical
Methods
John Leth
with R̂ −1 = R1 R2 · · · Rn .
orthogonal projector
QR Factorization
Another way of computing the (full) QR factorization is by means of
The full QR factorization
Householder Triangulation (HT) which can be view as successive application Example of how to use the
of elementary unitary matrices Rk on the left of A QR factorization
Gram-Schmidt
Orthogonalization
Qn · · · Q2 Q1 A = R orthogonal triangulation
Modified Gram-Schmidt
Operation count
with Q ∗ = Qn · · · Q2 Q1 . 16 A remark
Projectors
Note that since A is hermitian Example
Complementary projectors
y ∗ Ax = x ∗ Ay , Orthogonal projectors
The SVD and EVD of an
orthogonal projectors
hence x ∗ Ax ∈ R. Construction of an
orthogonal projector
Definition QR Factorization
A Cholesky factorization of a positive definite A is a factorization The full QR factorization
Example of how to use the
A = R ∗ R,
QR factorization
Gram-Schmidt
Orthogonalization
where R is upper-triangular with positive diagonal. Modified Gram-Schmidt
Operation count
▶ Cholesky factorization involves only half as many operations as Gaussian A remark
q Pi−1 Pi−1
rii = aii − r2 , rij = (aij − rkj rki )/rii , i ≤ j.
k=1 ki k=1
Matrix Computations:
Theory and Numerical
Methods
John Leth
Projectors
Theorem Example
Every positive definite A has a unique Cholesky factorization. Complementary projectors
Orthogonal projectors
The SVD and EVD of an
orthogonal projectors
The factor R in the Cholesky factorization RR ∗ of A are sometimes referred to Construction of an
as the (matrix) square root of A and denoted A1/2 . The notion of a (matrix)
orthogonal projector
QR Factorization
square root can be generalized to positive semi-definite matrices
The full QR factorization
Example of how to use the
QR factorization
Cholesky Factorization
square root of A.