



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!




EE364b Convex Optimization II Prof. S. Boyd May 27 - 30, 2011
By now, you know how it works, so we won’t repeat it here. (If not, see the instructions for the EE364a final exam.) Since you have 72 hours to work on the final, your solutions must be typeset using LATEX. We are expecting your solutions to be typo-free, clear, and correctly typeset. (And yes, we will deduct points for poor typesetting, typos, or unclear solutions.) All code submitted must be clear, commented and readable.
Email your solutions to [email protected] by Monday May 30 7pm at the latest.
To download Matlab files containing problem data, you’ll have to type the whole URL given in the problem into your browser; there are no links on the course web page pointing to these files. To get a file called filename.m, for example, you would retrieve
http://www.stanford.edu/class/ee364b/final_data/filename.m
with your browser.
(a) Explain how to use the (projected) stochastic subgradient method, using one return sample for each iteration, to find (in the limit) a log-optimal portfolio. Describe how to carry out the projection required, and how to update the portfolio in each iteration. (b) Implement the method and run it on the problem with n = 10 assets, with return sample oracle in the mfile log_opt_return_sample(m). This function returns an n × m matrix whose columns are independent return samples. You are welcome to look inside this file to see how we are generating the sample. The distribution is a mixture of two log-normal distributions; you can think of one as the standard return model and the other as the return model in some abnormal regime. However, your stochastic subgradient algorithm can only call log_opt_return_sample(1), once per iteration; you cannot use any information found inside the file in your implementation. To get a Monte Carlo approximation of the objective function value, you can gen- erate a block of, say, 10^5 samples (using R_emp=log_opt_return_sample(1e5), which only needs to be done once), and then use obj_hat = mean(log(R_emp’*x)) as your estimate of the objective function. Plot the (approximate) objective value versus iteration, as well as the best approximate objective value obtained up to that iteration. (Note that evaluating the objective will require far more compu- tation than each stochastic subgradient step.) You may need to play around with the step size selection in your method to get reasonable convergence. Remember that your objective value evaluation is only an approximation.
minimize 1 T^ (dmin^ − d)+ + 1 T^ (d − dmax)+ subject to 0 b 1 , d = Ab,
with variables b and d.
(a) Explain how to use ADMM to solve the treatment planning problem, with one step handling the linear equality constraint relating b and d, and the other step handling the nonlinear objective in d and the constraints on b. Work out each step explicitly, and give the computational cost (in order). You may not use CVX for the prox operators (we will deduct points for solutions that do). You can use factorization caching for the step that handles the equality constraint, so give the computational cost for the first iteration and subsequent iterations separately. You can assume that A is dense. (In real problems, A is sparse.) Hints. Work out the projection onto the equality constraint, and try to express it in terms of (I + AT^ A)−^1 , not (I + AAT^ )−^1 using the matrix inversion lemma. You may also find it useful to cache AT^ A. If your cost per iteration (after the first one) is not O(mn), it’s wrong. (b) Implement ADMM for the problem instance given in dosage_opt_data.m. This script calls line_pixel_length.m (while creating the matrix A), which you will also need to download. The problem instance is 2-dimensional, with a rectangular 50 × 50 array of pixels (voxels), so m = 2500. These pixels are divided into 3 groups: a ‘tumor’ region, two ‘critical’ regions, and the other pixels. (The tumor and critical regions are rectangular in this problem instance.) In each of these regions, dmin^ and dmax^ are constant within their respective regions. There are a total of n = 400 beams. Each beam is a simple line, and Aij is the length of line j in pixel i. (In a real problem, the matrix A is more complicated.) The beams are 20 sets of 20 parallel beams, evenly spaced through the center of the area, with angles varying every 9◦
from 0◦^ to 171◦. (You won’t need this information, since we compute the matrix A for you.)
In addition to defining the problem data, the script will create several relevant plots. The first plot simply shows the geometry of the tumor and critical regions. The second plot shows the dosage that results from uniform beam levels, and the third plots show histograms of pixel dosages for the tumor region, the critical regions, and the other pixels, along with the respective lower and upper target dosages. (Hopefully, your design will be much better.)
Check your solution using CVX (which might take a minute or two).
Plot the dosage pattern obtained, and compare it to the one obtained with a uniform beam pattern. Do the same for the dosage histograms.