20.08.2013 Views

ECE 174 Homework # 4 Solutions - UCSD DSP Lab

ECE 174 Homework # 4 Solutions - UCSD DSP Lab

ECE 174 Homework # 4 Solutions - UCSD DSP Lab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ECE</strong> <strong>174</strong> <strong>Homework</strong> # 4 <strong>Solutions</strong><br />

Reminder: Midterm is Tuesday, May 19, 2009<br />

The midterm is closed notes and book. Bring paper and pen only. No Electronic devices at<br />

all are allowed. You are encouraged to study the homework and sample midterm solutions<br />

well.<br />

<strong>Solutions</strong><br />

1. Recall that we (and Meyer) define the inner product to be linear in the second argument.<br />

1 Also recall that 〈x1, x2〉 = 〈x2, x2〉.<br />

(a) 〈x1, αx2〉 = α 〈x1, x2〉 = α 〈x1, x2〉 = α 〈x2, x1〉 = 〈x2, αx1〉 = 〈αx1, x2〉.<br />

(b) 〈α1x1 + α2x2, x〉 = 〈x, α1x1 + α2x2〉 = α1 〈x, x1〉 + α2 〈x, x2〉<br />

= α1 〈x1, x〉 + α2 〈x2, x〉<br />

Note that in part (b) we obtain the property of additivity in the first argument as a<br />

special case (just take α1 = α2 = 1).<br />

2. Recall that the operators A : X → Y, B : X → Y, and C : Y → Z are linear and that<br />

the adjoint operator, A ∗ , is defined by<br />

〈A ∗ x1, x2〉 = 〈x1, Ax2〉 .<br />

You also need to recall the properties of the inner product (such as linearity in the<br />

second argument) and the additional properties proved in Problem 1 above.<br />

(a) 〈y, αAx〉 = 〈y, Aαx〉 = 〈A ∗ y, αx〉 = 〈αA ∗ y, x〉.<br />

(b) 〈y, (A + B)x〉 = 〈y, Ax + Bx〉 = 〈y, Ax〉 + 〈x, Bx〉 = 〈A ∗ y, x〉 + 〈B ∗ y, x〉<br />

〈A ∗ y + B ∗ y, x〉 = 〈(A ∗ + B ∗ )y, x〉.<br />

(c) The fact that (αA + βB) ∗ = αA ∗ + βB ∗ follows immediate from properties (b)<br />

and (a), in that order.<br />

(d) 〈x, A ∗ y〉 = 〈A ∗ y, x〉 = 〈y, Ax〉 = 〈Ax, y〉.<br />

(e) 〈z, CAx〉 = 〈C ∗ z, Ax〉 = 〈A ∗ C ∗ z, a〉.<br />

(f) 〈A ∗ αy, x〉 = 〈αy, Ax〉 = α 〈y, Ax〉 = α 〈A ∗ y, x〉 = 〈αA ∗ y, x〉.<br />

(g) 〈A ∗ (y1 + y2), x〉 = 〈y1 + y2, Ax〉 = 〈y1, Ax〉 + 〈y2, Ax〉 = 〈A ∗ y1, x〉 + 〈A ∗ y2, x〉<br />

= 〈A ∗ y1 + A ∗ y2, x〉.<br />

(h) Linearity of A ∗ follows from properties (g) and (f), in that order.<br />

1 Whereas many other authors define the inner product to be linear in the first argument. Of course, in<br />

the real vector space case the inner product is linear in both arguments so that the distinction disappears.<br />

1


3. Recall that the inner–products are defined as,<br />

〈x1, x2〉 = x H 1 Ωx2 and 〈y1, y2〉 = y H 1 W y2 ,<br />

where Ω and W are hermitian (i.e., Ω H = Ω and W H = W ) and positive–definite (and<br />

hence both are invertible). Note that in this case their inverses are also hermitian,<br />

positive–definite.<br />

(a) 〈y, Ax〉 = y H W Ax = y H W AΩ −1 Ωx = (Ω −1 A H W )y H Ωx = (Ω −1 A H W )y, x .<br />

(b) For r(A) = n, A has full column rank and it must be the case that m ≥ n. Since<br />

A is possibly over–determined, we solve the least squares problem by enforcing<br />

the geometric condition that y − Ax ∈ R(A) ⊥ = N (A ∗ ). This yields the normal<br />

equations,<br />

A ∗ Ax = A ∗ y .<br />

Because r(A) = n, the n×n matrix A ∗ A also has rank n and is therefore invertible.<br />

(This fact is consistent with the nullspace of A being trivial, so that the least–<br />

squares problem must have a unique solution.) Thus, we have that<br />

r(A) = n ⇒ x = (A ∗ A) −1 A ∗ y ,<br />

for any value of y. It must therefore be the case that<br />

r(A) = n ⇒ A + = (A ∗ A) −1 A ∗ ,<br />

where A ∗ = Ω −1 A H W as determined in Part (a). With W a full rank hermitian<br />

matrix and r(A) = n, it is the case that A H W A is invertible and as a consequence<br />

the pseudoinverse, A ∗ , is independent of the weighting matrix Ω,<br />

r(A) = n ⇒ A + = (A H W A) −1 A H W .<br />

(c) For r(A) = m, A has full row–rank and therefore it must be the case that n ≥ m.<br />

Note that A is onto, and therefore y = Ax is solvable for all y. However, the system<br />

is possibly underdetermined, so we want to look for a minimum norm solution.<br />

This requires that we enforce the constraint that any solution to y = Ax must<br />

also satisfy the geometric condition that x ∈ N (A) ⊥ = R(A ∗ ). This condition is<br />

equivalent to,<br />

x = A ∗ λ ,<br />

for some vector λ.<br />

This condition, together with the requirement that x be a solution to y = Ax, yields,<br />

AA ∗ λ = y .<br />

2


Because r(A) = m, the m × m matrix AA ∗ also has rank n and is invertible. Thus,<br />

which yields the result that<br />

for all y. Thus,<br />

λ = (AA ∗ ) −1 y<br />

r(A) = m ⇒ x = A ∗ (AA ∗ ) −1 y ,<br />

r(A) = m ⇒ A + = A ∗ (AA ∗ ) −1 .<br />

With r(A) = m and Ω −1 a hermitian full–rank matrix, it is the case that the m × m<br />

matrix AΩ −1 A H is invertible. With the fact that A ∗ = Ω −1 A H W , this yields the fact<br />

that for r(A) = m, the pseudoinverse is independent of the weighting matrix W ,<br />

r(A) = m ⇒ A + = Ω −1 A H (AΩ −1 A H ) −1 .<br />

4. The minimum power–dissipation problem. We will solve part (b) first, then part (a).<br />

(b) x = (I1, I2, I3) T , A = (1, 1, 1), and y = I. Note that the rank of A is m = 1, so<br />

that A is onto (has full row rank) and therefore A + = A ∗ (AA ∗ ) −1 . The inner product<br />

on the domain (“input space”) has weighting matrix Ω = diag(R1, R2, R3).<br />

With this setup we have that the total power dissipated in the resistors is P =<br />

x 2 . The inner product on the codomain (“output space”) can be taken to have<br />

a weighting “matrix” W = 1. The adjoint operator is<br />

Also,<br />

This yields,<br />

A ∗ = Ω −1 A T W = Ω −1 A T =<br />

(AA ∗ ) −1 = (AΩ −1 A T ) −1 =<br />

1<br />

R1<br />

1<br />

+ 1<br />

R2<br />

A + = A ∗ (AA ∗ ) −1 = Ω −1 A T (AΩ −1 A T ) −1 =<br />

<br />

1<br />

,<br />

R1<br />

1<br />

,<br />

R2<br />

1<br />

R3<br />

+ 1<br />

R3<br />

Thus the optimum currents through the resistors are<br />

⎛ ⎞<br />

I1<br />

⎝ ⎠ = x = A + I<br />

y =<br />

I2<br />

I3<br />

=<br />

R2R3 + R1R3 + R1R2<br />

3<br />

T<br />

.<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

1<br />

R2R3 + R1R3 + R1R2<br />

⎛<br />

⎝<br />

R2R3<br />

R1R3<br />

R1R2<br />

⎞<br />

⎠ .<br />

⎛<br />

⎝<br />

.<br />

R2R3<br />

R1R3<br />

R1R2<br />

⎞<br />

⎠ .


Note that I1 + I2 + I3 = I as required. The vector of optimal voltages is given by<br />

the vector Ωx and yields the answer,<br />

V1 = V2 = V3 =<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

The optimum (minimum) solution power dissipation is computed as,<br />

Note that<br />

P opt = x 2 = x T Ωx = (A + y) T ΩA + y = y T A +T ΩA + y .<br />

A +T ΩA + = (AΩ −1 A T ) −1 AΩ −1 A T (AΩ −1 A T ) −1 = (AΩ −1 A T ) −1 ,<br />

which was computed above. Therefore,<br />

P opt = I 2<br />

which is dimensionally correct (“P = I 2 R”).<br />

(a) x = (V1, V2, V3) T ,<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

<br />

1<br />

A = ,<br />

R1<br />

1<br />

,<br />

R2<br />

1<br />

<br />

,<br />

R3<br />

and y = I. The rank of A is m = 1, so that A is onto (has full row rank) and<br />

therefore A + = A ∗ (AA ∗ ) −1 . The inner product on the domain (“input space”)<br />

has weighting matrix,<br />

<br />

1<br />

Ω = diag ,<br />

R1<br />

1<br />

,<br />

R2<br />

1<br />

<br />

.<br />

R3<br />

With this setup we again have that the total power dissipated in the resistors is<br />

P = x 2 . And again the inner product on the codomain (“output space”) can<br />

be taken to have a weighting “matrix” W = 1. The adjoint operator is<br />

Also,<br />

This yields,<br />

(AA ∗ ) −1 = (AΩ −1 A T ) −1 =<br />

A ∗ = Ω −1 A T W = Ω −1 A T = (1, 1, 1) T .<br />

1<br />

R1<br />

1<br />

+ 1<br />

R2<br />

+ 1<br />

R3<br />

A + = A ∗ (AA ∗ ) −1 = Ω −1 A T (AΩ −1 A T ) −1 =<br />

4<br />

=<br />

,<br />

I .<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

.<br />

⎛ ⎞<br />

1<br />

⎝1⎠<br />

.<br />

1


With the optimal solution given by x = A + y this yields optimum voltages of<br />

V1 = V2 = V3 =<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

exactly as before. The optimum (minimum) solution power dissipation is again<br />

computed as,<br />

where<br />

P opt = x 2 = x T Ωx = (A + y) T ΩA + y = y T A +T ΩA + y ,<br />

A +T ΩA + = (AΩ −1 A T ) −1 AΩ −1 A T (AΩ −1 A T ) −1 = (AΩ −1 A T ) −1 ,<br />

which was computed above. Therefore,<br />

exactly as before.<br />

P opt = I 2<br />

R1R2R3<br />

R2R3 + R1R3 + R1R2<br />

5. The two situations correspond to the mutually exclusive cases of a) b is in the range<br />

of A, and b) nonzero b is not in the range of A.<br />

6. Meyer Problem 4.6.7. Let the data pairs be given by (xk, yk), k = 1, · · · , m = 11.<br />

(E.g., (x1, y1) = (−5, 2), etc.). For both the line fit and the quadratic fit, we want to<br />

place the problem in the vector–matrix form,<br />

y = Aα<br />

for A m × n, where n is the dimension of the unknown parameter vector α, and solve<br />

for α in the least-squares sense. For the linear fit we have,<br />

⎛ ⎞<br />

y1<br />

⎜ y2<br />

⎟<br />

y = ⎜ ⎟<br />

⎝ . ⎠<br />

ym<br />

=<br />

⎛<br />

1<br />

⎜<br />

⎜1<br />

⎜<br />

⎝.<br />

⎞<br />

x1<br />

x2<br />

⎟ <br />

⎟ α0<br />

⎟ = Aα ,<br />

. ⎠ α1<br />

1 xm<br />

with n = 2. While for the quadratic fit we have,<br />

⎛ ⎞<br />

y1<br />

⎜ y2<br />

⎟<br />

y = ⎜ ⎟<br />

⎝ . ⎠<br />

ym<br />

=<br />

⎛<br />

1<br />

⎜<br />

⎝<br />

x1 x2 1 x2<br />

1<br />

x2 . .<br />

2<br />

.<br />

1 xm x2 ⎞<br />

⎛<br />

⎟ ⎝<br />

⎠<br />

m<br />

α0<br />

α1<br />

α2<br />

⎞<br />

,<br />

⎠ = Aα ,<br />

with n = 3. Note that in both cases we have the data to fill in numerical values of y<br />

and A. In both cases we have that the matrix A is full rank (you can check in matlab,<br />

5<br />

I ,


ut it will usually be true for this type of problem). Thus the least squares solution<br />

can be determined as,<br />

α = (A T A) −1 A T y .<br />

The optimal least–squares error has magnitude,<br />

e 2 = y − Aα 2 = (y − Aα) T (y − Aα) ,<br />

which can be computed for both the quadratic and linear fits. In this case you will<br />

find that the quadratic fit provides a much tighter fit to the data. Once you have the<br />

parameters at hand, you can perform the prediction by plugging in the new value for<br />

xk.<br />

Question:<br />

Given measured data (xk, yk), k = 1, · · · , m can you fit the model,<br />

Or the model,<br />

y ≈ α0 + α3x 3 + α9x 9 ?<br />

y ≈ αx + βe x + γ cos(12x 3 ) ?<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!