Docsity

Lecture Notes on Matrix - Electromagnetic Theory | PHYS 210A, Study notes of Physics

Toggle sidebar
bg1
Matrix rank
Matrix products:ATAand AAT
Claim: rank(ATA) = rank(A) = rank(AT)
Proof:
rank(ATA) = rank(A)−dim(N!AT"∩R(A))
#$% &
= rank(A)
= 0
N!AT"
R(A)
!
0
N(A)
R!AT"
!
0
!
AT
"
A
#
AT
$
AR!ATA"=R!AT"
R!AAT"=R(A)
N!ATA"=N(A)
N!AAT"=N!AT"
Roy Smith: ECE 210a: 4.2
Matrix rank
Matrix products:A∈Rm×n,B∈Rn×p,AB ∈Rm×p.
rank(AB) = rank(B)−dim(N(A)∩R(B)).
rank(B) + rank(A)−n≤rank(AB)≤min{rank(A),rank(B)}
N!AT"
R(A)
!
0
N(A)
R!AT"
N(B)
R!BT"
!
0
"
A
$
A
"
B
$
B
dim = r
dim = m−r
dim = r
dim = n−r
dim = s
dim = p−s
Roy Smith: ECE 210a: 4.1
pf3
pf4
pf5

Partial preview of the text

Download Lecture Notes on Matrix - Electromagnetic Theory | PHYS 210A and more Study notes Physics in PDF only on Docsity!

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

A

T

∩ R (A))

= rank(A)

N

A

T

R (A)

!

N (A)

R

A

T

!

!

A

T

"

A

A

T

$

A R

A

T A

= R

A

T

R

AA

T

= R (A)

N

A

T A

= N (A)

N

AA

T

= N

A

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)}

N

A

T

R (A)

!

N (A)

R

A

T

N (B)

R

B

T

!

"

A

$

A

"

B

$

B

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ˆ =

A

T A

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

A

T A

exists.

Inconsistent case: b ∈/ R (A)

But for the normal equations, A T Ax = A T b,

A

T b ∈ R

A

T

= R

A

T A

so the normal equations are always consistent.

Furthermore, if N (A) = 0, then,

x =

A

T A

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

N

A

T A

= N (A) =⇒ x

⊥ ∈ N

A

T A

So, for x ∈ x (^) soln ,

A

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

A

[

α

β

]

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,

A

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

A

T Aδ (^) x + δ T x

A

T Ax (^) soln + x T soln

A

T Aδ (^) x + x T soln

A

T Ax (^) soln − 2 δ T x

A

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

A

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,

BY [T^ ]^ BX =^

[

[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 ,

P := BY [I] BX.

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 t

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

A

α 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 =

A

T A

A

T b.

Roy Smith: ECE 210a: 4.

Similarity and bases

DFT

Express this as a matrix operation:

X(0)

X(1)

X(2)

X(N − 1)

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

F N

The Fourier matrix, F (^) N , has the properties:

− F N ∈ C

N ×N ;

− F (^) N is a Vandermonde matrix (see 2 .8);

− F

− 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) =

N∑ − 1

k=

x(k)e

−j 2 πki N (^) , i = 0,... , N − 1 ,

and the inverse DFT is given by:

x(k) =

N

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

N − 1 ∑

i=

X(i) ξ

−ki , k = 0,... , N − 1.

Roy Smith: ECE 210a: 4.