11
F21 EECS 551 ©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 1 Pr. 1. (a) One application of the “ vec trick” vec(AXB T )=(B A)vec(X) is for computing a 2D discrete Fourier transform (DFT) of a 2D signal. The (1D) DFT of a vector x C N is the vector f x C N with entries [f x ] k = N X n=1 x n exp -2πi(k - 1)(n - 1) N , k =1,...,N. (Here we are using the linear algebra (and Julia) convention where the first array index is 1, whereas DSP books usually use 0,...,N - 1.) We can represent the above computation in matrix-vector form as f x = F N x, where F N is the N × N DFT matrix with entries [F N ] k,n = exp -2πi(k - 1)(n - 1) N , k,n =1,...,N. We can generate F N in Julia as follows. #N × N DFT matrix using FFTW: fft using LinearAlgebra: I F = fft(I(N), 1) One can verify that F 0 N F N = N I N , so the (1D) inverse DFT of f x can be computed as x = (1/N )F 0 N f x . In two dimensions, we compute the 2D DFT, call it S X , of the M × N matrix X, by computing the 1D DFT of each column of X followed by the 1D DFT of each row of the result (or vice versa). Explain why the following expression computes the 2D DFT of X: S X = F M XF T N . Now write vec(S X ) as the product of a matrix and vec(X). (b) Show that the following expression computes the 2D inverse DFT of S X : X = 1 MN F 0 M S X F N , where Y denotes (element-wise) complex conjugate of matrix Y . Hint: Use the fact that F 0 N F N = F N F 0 N = N I N . Now write vec(X) as the product of a matrix and vec(S X ). Pr. 2. (a) Find (by hand) all solutions of the linear least squares problem arg min xR 2 kAx - bk 2 when A = 1 1 1 1 and b = 1 2 . (b) Describe briefly how you would modify your solution for this variation of the problem: arg min xC 2 kAx - bk 2 . Pr. 3. In the ordinary least-squares problem we found the (minimum norm) ˆ x that minimized krk 2 where r = b - Ax is the residual. We saw that the optimal x can be expressed entirely in terms of b and an SVD of A. Let A be a M × N matrix so that x F N and b F M and r F M . In applications with heteroscedastic measurement errors, we prefer to minimize kWrk 2 , i.e., a weighted squared error, where W is a diagonal matrix having diagonal entries w 1 ,...w M 0. Determine the optimal x for this weighted least-squares problem. (Again, you should express the answer in terms of b, W , and an SVD of an appropriate matrix.) Your answer must not have any pseudo-inverse in it! (It may have an inverse as long as you are sure that the matrix is invertible and trivial to invert.) You may assume that W*A == zeros(size(W*A)) is false in Julia.

AXBT B A X transform x2CN X N

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 1

Pr. 1.

(a) One application of the “vec trick” vec(AXBT ) = (B ⊗ A)vec(X) is for computing a 2D discrete Fouriertransform (DFT) of a 2D signal. The (1D) DFT of a vector x ∈ CN is the vector fx ∈ CN with entries

[fx]k =

N∑n=1

xn exp

(−2πi(k − 1)(n− 1)

N

), k = 1, . . . , N.

(Here we are using the linear algebra (and Julia) convention where the first array index is 1, whereas DSP booksusually use 0, . . . , N − 1.) We can represent the above computation in matrix-vector form as fx = FNx, whereFN is the N ×N DFT matrix with entries

[FN ]k,n = exp

(−2πi(k − 1)(n− 1)

N

), k, n = 1, . . . , N.

We can generate FN in Julia as follows.

# N × N DFT matrixusing FFTW: fftusing LinearAlgebra: IF = fft(I(N), 1)

One can verify that F ′NFN = NIN , so the (1D) inverse DFT of fx can be computed as x = (1/N)F ′Nfx.In two dimensions, we compute the 2D DFT, call it SX , of the M ×N matrix X, by computing the 1D DFTof each column of X followed by the 1D DFT of each row of the result (or vice versa).Explain why the following expression computes the 2D DFT of X:

SX = FMXFTN .

Now write vec(SX) as the product of a matrix and vec(X).

(b) Show that the following expression computes the 2D inverse DFT of SX :

X =1

MNF ′MSXFN ,

where Y denotes (element-wise) complex conjugate of matrix Y .Hint: Use the fact that F ′NFN = FNF

′N = NIN .

Now write vec(X) as the product of a matrix and vec(SX).

Pr. 2.

(a) Find (by hand) all solutions of the linear least squares problem argminx∈R2 ‖Ax − b‖2 when A =

[1 11 1

]and b =

[12

].

(b) Describe briefly how you would modify your solution for this variation of the problem: argminx∈C2 ‖Ax− b‖2.

Pr. 3.In the ordinary least-squares problem we found the (minimum norm) x̂ that minimized ‖r‖2 where r = b −Axis the residual. We saw that the optimal x can be expressed entirely in terms of b and an SVD of A. Let A be aM ×N matrix so that x ∈ FN and b ∈ FM and r ∈ FM .In applications with heteroscedastic measurement errors, we prefer to minimize ‖Wr‖2, i.e., a weighted squarederror, where W is a diagonal matrix having diagonal entries w1, . . . wM ≥ 0. Determine the optimal x for thisweighted least-squares problem. (Again, you should express the answer in terms of b, W , and an SVD of anappropriate matrix.) Your answer must not have any pseudo-inverse in it! (It may have an inverse as long as youare sure that the matrix is invertible and trivial to invert.) You may assume that W*A == zeros(size(W*A)) isfalse in Julia.

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 2

Pr. 4.Recall that the least squares problem

x̂ = argminx

1

2‖Ax− b‖22,

has the solution x̂ = A+b where A+ denotes the pseudo-inverse. When the nullspace of A is non-trivial then x̂is the minimum norm solution. When A is large, it can be computationally prohibitive to compute an SVD of Aand then its pseudo-inverse before computing x̂. In such settings, the gradient descent iteration given by

xk+1 = xk − µA′ (Axk − b) ,

will converge to a minimizer of ‖Ax− b‖22 as iteration k →∞ when 0 < µ < 2/σ21(A). Note that the iteration has

a fixed point, i.e., xk+1 = xk ifA′(Axk − b) = 0,

which are exactly the normal equations. So any fixed point minimizes the least squares cost function.

(a) Write a function called lsgd that implements the above least squares gradient descent algorithm.

In Julia, your file should be named lsgd.jl and should contain the following function:

"""x = lsgd(A, b ; mu=0, x0=zeros(size(A,2)), nIters::Int=200)

Performs gradient descent to solve the least squares problem:``\\argmin_x 0.5 \\| b − A x \\|_2``

In:− `A` `m × n` matrix− `b` vector of length `m`

Option:− `mu` step size to use, and must satisfy ``0 < mu < 2 / \\sigma_1(A)^2``to guarantee convergence,where ``\\sigma_1(A)`` is the first (largest) singular value.Ch.5 will explain a default value for `mu`− `x0` is the initial starting vector (of length `n`) to use.Its default value is all zeros for simplicity.− `nIters` is the number of iterations to perform (default 200)

Out:− `x` vector of length `n` containing the approximate LS solution"""function lsgd(A, b ; mu::Real=0, x0=zeros(size(A,2)), nIters::Int=200)

Email your solution as an attachment to [email protected].

The function specification above uses a powerful feature of Julia where functions can have optional argumentswith specified default values. If you simply call lsgd(A,b) then mu , x0 and nIters will all have their

default values. But if you call, say, lsgd(A, b, nIters=5, mu=7) then it will use the specified values fornIters and mu and the default for x0 . Note that these named optional arguments can appear in any order.This approach is very convenient for functions with multiple arguments.

(b) After your code passes, use it to generate a plot of log10(‖xk − x̂‖) versus k = 0, 1. . . . , 200 using µ = 1/σ21(A)

for A and b generated as follows

using Random: seed!m = 100; n = 50; sigma = 0.1seed!(0) # seed random number generatorA = randn(m, n); xtrue = rand(n); noise = randn(m)b = A * xtrue + sigma * noise # b and xhat change when sigma changes

Repeat for σ = 0.5, 1, 2 and turn in one plot with all four curves on it, using a logarithmic scale for the verticalaxis. Does ‖xk − x̂‖ decrease monotonically with k in the plots? Note that σ = sigma here is a noise standarddeviation unrelated to singular values.

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 3

Pr. 5.

(a) For δ > 0, determine the solution of the regularized least-squares problem

x̂(δ) = argminx

1

2‖Ax− b‖22 + δ2

1

2‖x‖22.

Express the answer in terms of the SVD of an appropriate matrix.Use the fact that B+ = (B′B)−1B′ when B′B is invertible to simplify the expression.Hint: Rewrite the cost function so it looks like a usual least-squares problem.

(b) What does x̂(δ) tend to as δ →∞? Does this answer make sense?

(c) Write (by hand, not code) an iteration based on the gradient descent (GD) method such that the iteratesconverge to the minimizer x̂(δ).

(d) Determine a condition on the step size µ that guarantees convergence of your GD method. Express the conditionin terms of the original problem quantities: A, b, and δ.

Pr. 6.Consider the problem of finding the minimum 2-norm solution of the linear least squares problem

x̂ = argminx ‖Ax− b‖2 when A =

[1 00 0

]and b =

[11

]. The solution is: x̂ = A+b =

[1 00 0

] [11

]=

[10

].

(a) Consider a perturbation E1 =

[0 δ0 0

]of A, where δ is a small positive number. Solve the perturbed version of

the above problem: z∗ = argminz ‖A1z − b‖2, where A1 = A+E1.

What happens to ‖x̂− z∗‖2 as δ approaches 0?

(b) Now consider the perturbation E2 =

[0 00 δ

]where again δ is a small positive number. Solve the perturbed

problem z∗ = argminz ‖A2z − b‖2 where A2 = A+E2.

What happens to ‖x̂− z∗‖2 here as δ → 0?

Pr. 7.Given constants a, b, c, consider the plane

{(x, y, z) ∈ R3 : ax+ by + cz = 0

}that intersects the origin.

(a) Describe how you would use an SVD to find basis vectors for the plane.How many bases vectors are required to express a point on the plane?

(b) Find the point on the plane that is closest to an arbitrary point (α, β, γ) ∈ R3. Your expression should be generaland reasonably simple.

Anytime a problem says “find” something, it is also implied that you must also show how you found it.

(c) Using your preceding answer (and probably Julia or a calculator), find the point on the plane x+ 2y + 3z = 0that is closest to the point (4, 5, 6).

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 4

Pr. 8.(Photometric stereo: compute normals)In this problem you implement another tool needed for a computer vision method called photometric stereo,allowing us (eventually) to reconstruct a 3D object’s surface from 2D images of it under different lighting conditions.Figure 1 gives a preview at what you will be able to do after completing all the pieces.

Figure 1: Photometric stereo example. Left (a): 2D images of a common scene under different lighting conditions.Right (b): 3D surface reconstruction computed from the input images.

Suppose we are in a dark room with an object on a dark table, a camera fixed above it, and a moveable light source.We model the object surface as z = f(x, y), where (x, y) denotes coordinates on the table and z denotes height abovethe table. Assume that a m × n sized image I(x, y) is a representation of f(x, y) for each (x, y) tuple. (Given onelight source, f(x, y) is the z coordinate of the position where a ray of light hits the surface at (x, y, z).)As seen in Figure 1a, the pixel intensity I(x, y) indicates how much light reflects off the surface f(x, y). If our objectis diffuse (also called matte or Lambertian reflectance), one can derive the relationship

I(x, y) = α(x, y) (`Tn(x, y)), (1)

where ` ∈ R3 is a unit vector describing the orientation of the incident light rays on the surface, n(x, y) ∈ R3 is theunit-norm surface normal vector of f at (x, y, f(x, y)), and α(x, y) > 0 is a scaling constant called the surface albedo.

Now suppose that we take d images I1, . . . , Id of our object, with lighting directions `1, . . . , `d ∈ R3. We are goingto work on one pixel at a time. For any pixel location (x, y), we can stack (1) into an overdetermined system ofequations: I1(x, y)...

Id(x, y)

︸ ︷︷ ︸,gxy∈Rd

≈[`1 . . . `d

]T︸ ︷︷ ︸,LT

(α(x, y)n(x, y))︸ ︷︷ ︸,ρ(x,y)∈R3

. (2)

We could solve (2) for ρ(x, y) for each (x, y) when d = 3, but, in practice, when there is noise and our assumptionsdo not hold exactly, a more robust approach is to take d > 3 images in the least-squares problem

ρ̂(x, y) = argminr∈R3

‖gxy −LTr‖22. (3)

We then approximate the surface normal n by the following normalized estimate:

n̂(x, y) ,ρ̂(x, y)

‖ρ̂(x, y)‖2. (4)

Your task for this problem is to write a function called compute_normals that computes the unit-norm surfacenormal vectors for each pixel in a scene, given {Ii(x, y)} and {`i}, by solving (3). and applying (4).Hint: Julia’s normalize and mapslices functions are useful.In Julia, your file should be named compute_normals.jl and should contain the following function:

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 5

"""N = compute_normals(data, L)

In:− `data` `m × n × d` matrix whose `d` slices contain `m × n` imagesof a common scene under different lighting conditions

− `L` `3 × d` matrix whose columns are the lighting direction vectorsfor the images in data, with `d ≥ 3`

Out:− `N` `m × n × 3` matrix containing the unit−norm surface normal vectorsfor each pixel in the scene"""function compute_normals(data, L)

Email your solution as an attachment to [email protected]: The surface normals at each pixel are independent, so you can compute them all simultaneously by stackingthe solutions to (3) for each pixel into a single matrix expression, using reshape to help. This solution can beexpressed elegantly without using loops! (But it is OK to use loops if you prefer.)

Hint. You can test your code by applying it to synthetic data like the following.

include("../auto/test/compute_normals.jl") # use your own pathusing MIRTjim: jim

d = 8 # number of test imagesphi = LinRange(−1,1,8)*pi/3 # light anglesL = [sin.(phi) 0*cos.(phi) cos.(phi)]' # light unit vectorsm,n = 40,30 # image sizex0 = m/2 # cylinder center coordinater0 = 0.7m # cylinder radiusafun = (x,y) −> abs(x−x0) < r0/2 # albedo alpha(x,y)zfun = x −> abs(x) < r0 ? sqrt(r0^2 − x^2) : 0 # cylinder surfacenormal = (x,y) −> [(x−x0)/r0, 0, zfun(x−x0)/r0] # surface normalntrue = [normal(x,y)*afun(x,y) for x in 1:m, y in 1:n]ntrue = cat([map(x −> x[i], ntrue) for i=1:3]..., dims=3) # m × n × 3

data = zeros(Float32, m, n, d)for l=1:d

data[:,:,l] .= [L[:,l]'normal(x,y)*afun(x,y) for x in 1:m, y in 1:n]endjim(data, "$d images for different light positions")nhat = compute_normals(data, L)nhat[isnan.(nhat)] .= 0jim(cat(ntrue, nhat, nhat−ntrue, dims=4),

"true and estimated normals and error")

plot(jim(nhat[:,:,1], "x component of normal"),jim(nhat[:,:,2], "y component of normal"),jim(nhat[:,:,3], "z component of normal"),) # savefig("hp073.pdf")

This code simulates imaging part of the surface of a cylinder with different lighting positions and then appliescompute_normals to the simulated data. If your code is working properly, then the three estimated normals shouldlook like those in the following figure.

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 6

Pr. 9.(Photometric stereo continued)(This problem statement looks long, but it is actually quite easy because it uses tools you developed previously. You

need not write any new code for it.)For f : R2 7→ R, from vector calculus, we can express the surface normal vector of f at (x, y) as

n(x, y) =1√

1 +(

∂∂xf(x, y)

)2+(

∂∂yf(x, y)

)2− ∂

∂xf(x, y)− ∂

∂yf(x, y)

1

,

n1(x, y)n2(x, y)n3(x, y)

, (5)

where ∂∂xf and ∂

∂yf denote the partial derivatives of depth f(x, y) with respect to x and y, respectively.From (5), we can compute the partial derivatives as

∂f(x, y)

∂x= −n1(x, y)

n3(x, y),

∂f(x, y)

∂y= −n2(x, y)

n3(x, y). (6)

In a previous HW you constructed a matrixA satisfying[dfdxdfdy

]= A fxy, where dfdx and dfdy denote the vectorized

approximations of ∂f(x,y)∂x and ∂f(x,y)

∂y and fxy denotes the vectorized approximation of f(x, y). Using (6), we cancompute dfdx and dfdy from our normal vectors, and, using our A matrix, we can obtain the surface correspondingto our normal vectors by solving the following least squares problem:

fxy = argminf∈Rmn

∥∥∥∥[dfdxdfdy

]−Af

∥∥∥∥22

.

Download the photometric_stereo_xy notebook from the hw05 directory on Canvas, and copy your previouscompute_normals.jl and first_diffs_2d_matrix.jl solution files into the same directory. Now use Julia torun that Jupyter notebook. If you have installed the necessary packages mentioned in the notebook, and if you haveworking versions of the compute_normals and first_diffs_2d_matrix functions, then the notebook will runproperly and generate a surface view of the object.After f(x, y) is estimated, one can separately generate a stereolithography file (consisting of a collection of tessellatedtriangles) that can be rendered on a 3D display or printed by a 3D printer. Figure 2 depicts an actual 3D-print madefrom a solution to this problem generated with a Cube 3 printer.Submit a screenshot of the surface plot produced by your Jupyter notebook.It should look something like Fig. 2 but in color.

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 7

Figure 2: 3D printed reconstruction of the surface you will reconstruct in Problem 9. The 3D printing quality wasintentionally set coarse so you can see how the printer constructed the shape from its level curves.

Pr. 10.Hand-written digit classification using nearest subspace (discussion task)This task illustrates how to use subspace-based classification with image features for classifying handwrittendigits. For this machine learning problem, we focus on just the two digits “4” and “9,” although the principlesgeneralize to all digits. Previously we focused on “0” and “1” because the previous classification methods were lesspowerful. With the subspace approach, you can now tackle the harder problem of distinguishing “4” from “9.”Download the task-2-classify-subspace.ipynb jupyter notebook file from Canvas under this week’s discussionfolder and follow all instructions to complete the task. You may work individually, but we recommend that you workin pairs or groups of three.When you are finished, upload your solutions to gradescope. Note that the submission for the task is separate fromthe rest of the homework because the task allows you to submit as a group. Only upload one submission per group!Whoever uploads the group submission should add all group members in gradescope, using the “View or edit group”option on the right-hand sidebar after uploading a PDF and matching pages. Make sure to add all group members,because this is how they will receive credit.

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 8

Non-graded problem(s) below(Solutions will be provided for self check; do not submit to gradescope.)

Pr. 11.Let S and T denote subspaces of a vector space V. Prove or disprove the following.

(a) If S is a subset of T or vice versa, then the union of subspaces S ∪ T is a subspace of V.

(b) If the union of subspaces S ∪ T is a subspace of V, then S is a subset of T or vice versa.

Pr. 12.Suppose b = Φz for some vector z, where Φ is a Parseval tight frame.

(a) For δ ≥ 0, Express a solution of the regularized least-squares problem

x̂ = argminx

‖Φx− b‖22 + δ2‖x‖22

in terms of z as simply as possibly.

(b) When is your solution unique?

(c) What value of δ would be the most appropriate in this special case where Φ is a Parseval tight frame?

(d) What is the condition number of Φ here?

Pr. 13.

(a) Show that if Φ is a tight frame with frame bound α, then Φ′Φ � αI, i.e., αI−Φ′Φ is positive semidefinite.

(b) What can you say about αI −ΦΦ′?

Pr. 14.The following Venn diagram summarizes relationships related to projection operations.

A1

Squarematrices

A2

IdempotentProjection matrix

P 2 = Pdiagonalizable

eigenvalues {0, 1}

A3

Orthogonalprojection matrix

P = P ′

normal

A4

Nonzero orthogonalprojection matrix

P = QQ′

where Q′Q = I

A5

Diagonalwith {0, 1}elements

I

Each of the categories shown above is a strict superset of the categories nested with in it.Provide example matrices A1, . . . ,A5 that belong to the each of the categories above but not the next categorynested within it. Try to provide the simplest possible example in each case.

Pr. 15.Throughout the problems below you may reuse properties you derived in earlier parts as long as you refer back tothe properties you use.

(a) Let A =∑r

i=1 σiuiv′i denote a compact SVD of A where r denotes the rank of A.

Then in terms of the singular vectors {ui} and {vi}:

(1) PR(A) =

(2) PR⊥(A) =

(3) PR(A′) =

(4) PR⊥(A′) =

(5) PN (A) =

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 9

(6) PN⊥(A) =

(7) PN (A′) =

(8) PN⊥(A′) =

(b) Let A = UΣV ′ denote a (full) SVD of A where r is the rank of A.Then in terms of the singular vectors {ui} and {vi}:

(1) P 2R(A) = ?

(2) P 3R(A) = ?

(3) P kR(A) =? for a positive integer k

(4) (I − PR(A))PR(A) =?

(5) (I − PR(A))k =? for a positive integer k

(6) (I − PR(A))kP jR(A) = ? for positive integers j and k

(7) PR(A) − P ′R(A) = ?

(8) rank(PR(A)

)= ?

(9) rank(PR⊥(A)

)= ?

(10) rank(I − PR(A)

)=?

(c) Let A = UΣV ′ be an SVD of A and r be the rank of A.Then in terms of the singular vectors {ui} and {vi}:

(1) ‖PR(A)‖F = ?

(2) ‖P kR(A)‖F = ? for a positive integer k

(3) ‖I − PR(A)‖F = ?

(4) ‖(I − PR(A))k‖F = ? for a positive integer k

(5) ‖PR(A)(I − PR(A))‖F = ?

(6)∏k

i=1(I − PR(ui))− PR⊥(u1,...,uk) = ? for any positive integer k

(d) Let A = UΣV ′ be an SVD of A and r be the rank of A. Find expressions for both a compact SVD and afull SVD for each of the following matrices.

(1) PR(A) = ?

(2) P⊥R(A) = ?

(3) PR(u1)A = ?

(4) PR(u1,...,uk)A = ? for k = 1, . . . , r

(5) PR(u1,...,uk)A = ? for r + 1 ≤ k ≤ min(m,n)

(6) APR(v1) = ?

(7) APR(v1,...,vk) = ? for k = 1, . . . , r

(8) APR(v1,...,vk) = ? for 1 ≤ k ≤ min(m,n) (Hint: think carefully about r.)

(9) PR(u1,...,uk)APR(v1,...,vk) = ? for k = 1, . . . , r

(10) PR(u1,...,uj)APR(v1,...,vk) = ? for 1 ≤ j, k ≤ min(m,n)

Pr. 16.Let A be an m×n matrix with SVD A = UΣV ′. Let ui denote the ith column of U , and vi denote the ith columnof V . Let σi is the ith diagonal element of Σ, and let A have rank r. Let Id denote the d× d identity matrix.Simplify the following pseudo-inverse expressions as much as possible.

(a) (1) (ui)+ =

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 10

(2) (uiu′i)

+ =

(3) (uiv′i)

+ =

(4) (σiuiv′i)

+ =

(b) (1) U+ =

(2) V + =

(3) UU+ =

(4) V V + =

(5) Σ+ =

(6) (UΣ)+ =

(7) (ΣV ′)+ =

(8) A+ = (UΣV ′)+ =

(9) (UV ′)+ =

(c) (1) For 1 ≤ k ≤ m, U [:, 1 : k]+ =

(2) For 1 ≤ k ≤ n, V [:, 1 : k]+ =

(3) For 1 ≤ k ≤ min{m,n}. Σ[1 : k, 1 : k]+ =

(4) For 1 ≤ k ≤ m, U [:, 1 : k]U [:, 1 : k]+ =

(5) For 1 ≤ k ≤ n, V [:, 1 : k]V [:, 1 : k]+ =

(6) For 1 ≤ k ≤ m, U [:, 1 : k]+U [:, 1 : k] =

(7) For 1 ≤ k ≤ n, V [:, 1 : k]+V [:, 1 : k] =

(d) (1) For 1 ≤ k ≤ m, Im −U [:, 1 : k]U [:, 1 : k]+ =

(2) For 1 ≤ k ≤ n, In − V [:, 1 : k]V [:, 1 : k]+ =

(3) For 1 ≤ k ≤ m, Ik −U [:, 1 : k]+U [:, 1 : k] =

(4) For 1 ≤ k ≤ n, Ik − V [:, 1 : k]+V [:, 1 : k] =

(e) (1) For 1 ≤ k ≤ r, (U [:, 1 : k]Σ[1 : k, 1 : k]V [:, 1 : k]′)+ =

(2) (A′)+ =

(3) (A+)′ =

(4) For α 6= 0, (αA)+ =

(5) (AA+)′ =

(6) (A+A)′ =

(f) (1) AA+ =

(2) A+A =

(3) AA+A =

(4) A+AA+ =

(5) (PR(A))+ =

(g) (1) (A′A)+A′ =

(2) A′(AA′)+ =

(3) If r = n, then A+A =

(4) If r = m, then AA+ =

(5) If r = n, then (A′A)−1A′ =

(6) If r = m, then A′(AA′)−1 =

F21 EECS 551©J. Fessler, Univ. of Michigan HW05, Due 11PM Thu. Oct. 07 11

Pr. 17.

(a) Show that if f1(x), f2(x), . . . , fn(x) are all convex functions of x, then the following are also convex func-tions:

(1)∑n

i=1 fi(x).

(2)∑n

i=1 wifi(x) for scalars wi ≥ 0.

(3) Provide an example wherein wi being negative breaks the convexity.

(4) max {f1, f2, . . . , fn}.

(b) Which of the following cost functions are convex functions of x? Assume that A and D are matrices and b is avector with compatible dimensions. Justify your answer: using the results from a previous part may help.

(1) ‖Ax− b‖22 + ‖Dx‖22.(2) ‖Ax− b‖22 + ‖Dx‖1.(3) ‖Ax− b‖22 − ‖Dx‖22.(4) ‖Ax− b‖22 − ‖Dx‖1.