



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!




Matrix rank
Matrix products: A
T A and AA
T
Claim: rank(A
T A) = rank(A) = rank(A
T )
Proof:
rank(A T A) = rank(A) − dim(N
T
= rank(A)
T
!
T
!
!
T
"
T
$
T A
T
T
T A
T
T
Matrix rank
Matrix products: A ∈ R
m×n , B ∈ R
n×p , AB ∈ R
m×p .
rank(AB) = rank(B) − dim(N (A) ∩ R (B)).
rank(B) + rank(A) − n ≤ rank(AB) ≤ min{rank(A), rank(B)}
T
!
T
T
!
"
$
"
$
dim = r
dim = m − r
dim = r
dim = n − r
dim = s
dim = p − s
Roy Smith: ECE 210a: 4.
Normal equations
Solving: Ax = b
To get a unique solution we need, b ∈ R (A) and N (A) = 0.
In this case,
xˆ =
T A
T b.
Note that A T A ∈ R n×n and rank(A T A) = rank(A) = n if N (A) = 0.
So the inverse
T A
exists.
Inconsistent case: b ∈/ R (A)
But for the normal equations, A T Ax = A T b,
T b ∈ R
T
T A
so the normal equations are always consistent.
Furthermore, if N (A) = 0, then,
x =
T A
T b,
uniquely solves the normal equations.
How does this relate to the original equation: Ax = b?
Normal equations
Solving: Ax = b
The equation, Ax = b is consistent if there exists at least one solution.
Consistent case
Clearly, Ax = b is consistent if and only if b ∈ R (A).
Choose a particular solution, Aˆx = b.
The general solution is the set,
x (^) soln =
xˆ + x
⊥
∣ (^) Aˆx = b, x ⊥^ ∈ N (A)
For x ∈ x (^) soln ,
Ax = A(ˆx + x
⊥ ) = Aˆx + Ax
⊥ = b.
Normal equations: A T Ax = A T b
Note that these have the same set of general solutions, because
T A
= N (A) =⇒ x
⊥ ∈ N
T A
So, for x ∈ x (^) soln ,
T Ax = A
T A(ˆx + x
⊥ ) = A
T Axˆ + A
T Ax
⊥ = A
T b.
Roy Smith: ECE 210a: 4.
Least squares
Least squares example: linear (affine) data fitting
Data: (t 1 , b 1 )
(t 2 , b 2 ) .. .
(tm , b (^) m )
Objective: Find α and β so that
b = α + βt approximates the data.
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
! %!
!
!
! !
!
!!
t 1
t 3 t 4 t 5 t 6
t
b
b = α + βt
Linear fitting equations:
1 t 1 . ..
1 tm
α
β
x
b (^1) . ..
b (^) m
b
Least squares
Converse: All solutions of the normal equations minimize the LS error.
Say x (^) soln is a solution of the normal equations,
T Ax (^) soln = A
T b.
Now consider any other x ∈ R n and define: δ (^) x = x − x (^) soln.
Then,
f (x) = (δ (^) x + x (^) soln ) T A T A(δ (^) x + x (^) soln ) − 2(δ (^) x + x (^) soln ) T A T b + b T b
= δ T x
T Aδ (^) x + δ T x
T Ax (^) soln + x T soln
T Aδ (^) x + x T soln
T Ax (^) soln − 2 δ T x
T b − 2 x (^) soln A T b + b T b
= f (x (^) soln ) + δ
T x A^
T Aδ (^) x ︸ ︷︷ ︸
(so x (^) soln minimizes f (x))
We can also see that δ T x A^
T Aδ (^) x = 0 implies that δ (^) x ∈ N (A) = N
T A
which in this case
means that δ (^) x and x are also solutions of the the normal equations.
Conclusion: x is a LS solution ⇐⇒ x solves the normal equations.
Caveat Emptor: For theoretical use only! A T Ax = A T b is much more likely to have
numerical problems than Ax = b.
Roy Smith: ECE 210a: 4.
Similarity and bases
Coordinate matrix representations (see 2 .16)
Given two sets of basis vectors of the same dimension,
B (^) X = { x 1 ,... , x (^) n } and B (^) Y = { y 1 ,... , yn } ,
where X = span(B (^) X ) and Y = span(B (^) Y ).
The coordinate matrix representation of an operator: T : X −→ Y is,
[T (x 1 )] (^) BY [T (x 2 )] (^) BY... [T (x (^) n )] (^) BY
In the case of an identity operator, [T (x (^) i )] (^) BY = [x (^) i ] (^) BY.
We can define the operator, P ,
The matrix, P , effectively changes the coordinates of a vector in the basis B (^) X to its
coordinates in the basis B (^) Y.
[v] (^) BY = P [v] (^) BX.
Least squares
Least squares: Fitting polynomials to data
Polynomial form: b = α 0 + α 1 t + α 2 t
2
n− 1
The matrix formulation is now:
1 t 1 t 2 1...^ t
n− 1 1 1 t 2 t 2 2
... t n− 1 2 .. .
1 tm t 2 m
... t n− 1 m
α 0
α 1 .. .
αn− 1
x
b (^1)
b (^2) .. .
b (^) m
b
In this case A is a Vandermonde matrix (see 2 .8).
If n ≤ m (the number of data points is greater than or equal to the order of the polynomial)
and ti ,= tj if i ,= j then N (A) = 0.
Therefore the LS solution is unique and (theoretically) given by,
x (^) opt =
T A
T b.
Roy Smith: ECE 210a: 4.
Similarity and bases
Express this as a matrix operation:
1 ξ ξ 2 · · · ξ N − 1
1 ξ
2 ξ
4 · · · ξ
N − 2
.. .
1 ξ
N − 1 ξ
N − 2 · · · ξ
x(0)
x(1)
x(2) .. .
x(N − 1)
ξ = e
−j 2 π N
The Fourier matrix, F (^) N , has the properties:
N ×N ;
− F (^) N is a Vandermonde matrix (see 2 .8);
− 1 N exists.
− others to be discussed later...
It can be viewed as a change of basis between the time-domain representation, and a
discrete-frequency representation.
Similarity and bases
Example: Discrete Fourier Transform (DFT)
Usual interpretation: sampling a time-domain signal:
x (^) k = x(t)|t=kT , k = 0,... , N − 1 , (T is the sample period)
The DFT is defined as:
X(i) =
k=
x(k)e
−j 2 πki N (^) , i = 0,... , N − 1 ,
and the inverse DFT is given by:
x(k) =
N − 1 ∑
i=
X(i)e
j 2 πki N (^) , k = 0,... , N − 1.
Simplifying notation: ξ := e
−j 2 π N
X(i) =
N − 1 ∑
k=
x(k) ξ
ki , i = 0,... , N − 1 ,
x(k) =
N − 1 ∑
i=
X(i) ξ
−ki , k = 0,... , N − 1.
Roy Smith: ECE 210a: 4.