代做CO 372: Portfolio Optimization Models Fall 2024 Problem Set 6代写留学生R语言
- 首页 >> OS编程CO 372: Portfolio Optimization Models
Fall 2024
Problem Set 6
Handed out: 2024-11-20.
Due: Fri, 2024-11-29, 4pm EST, on Crowdmark. Papers must be handed in on-line using the labeled dropbox on Crowdmark. The Crowdmark link will be sent out on the same day this is posted. Each question is handed in as a separate upload. You can either prepare your solutions electronically using, e.g., LaTeX, or else you can hand-write them and submit a scan. In the latter case, please take care that the scan is of good quality with a white background.
Your papers may be handed in up to 24 hours late, in which case there is a 10% late penalty. Please use the late-paper dropbox on Crowdmark if you are handing in a late paper. You may hand in some questions on time and others late. In this case, use the on-time dropbox for the on-time questions and the late dropbox for the late questions. However, you may not split the parts of a question (i.e., (a), (b), etc.) between the two dropboxes.
Collaboration policy. This problem set is a solo effort. Students are allowed to discuss question with each other in general terms including helping each other on Piazza. However, no student should share an entire solution to a question, nor should any student hand in work that entirely represents someone else’s effort.
1. Consider finding the portfolio to minimize 0.9-CVaR as measured from historical data
subject to a wealth constraint, a return constraint, and a no-short-sale constraint:
minx,α F0.9 (x,α)
s.t. eT x = 1,
r(¯)Tx ≥ rp ,
x ≥ 0.
Recall from lecture:
Here, r1 , . . . , rM denote M historical returns, each assumed to be equally likely. Also, rp as usual denotes the investor’s required return. Finally, recall from lecture that [s]+ stands for max(s,0).
Introduce variables t1 , . . . , tM so that the jth term in the summation can be upper- bounded by tj . Then rewrite the problem with these new variables and with a dif- ferentiable objective function and constraints. Explain why the rewritten program is actually linear programming.
2. Suppose the return r of a security follows a discrete probability distribution: r takes on values r1 < r2 < ··· < rN with probabilities p1 , . . . , pN . Here, p1 + ··· + pN = 1 and each pi > 0. Select a particular k ∈ {2,..., N}. Consider subtracting a small number θ > 0 from pk while simultaneously adding θ from p1 (so that the pi’s are still positive and still add to 1). Recall the definition of β-VaR of this distribution: it is 1 − rk , where k is such that Σk pi ≥ β while Σk+1pi < β . Recall the definition of β-CVaR of this distribution: for the same k as in the previous sentence, define,
and the β-CVaR is 1 − rtail.
(a) Write down an example of this set-up with N = 3 and k = 3 so that the perturbation θ described above causes a discontinuous jump in the β-VaR for an arbitrarily small θ > 0 (because k changes).
(b) Show that for your small example in (a), the β-CVaR varies continuously with θ (for small θ > 0).
For both (b) and (c), the value of rtail is a function of θ (including the unperturbed problem with θ = 0). For ease of marking, please use the notation rt(a(θ)i)l to denote the
value of rtail for a particular choice of θ .
(c) Show that the result in (b) is true in general. That is, show that if pk +···+pN = β (so that k jumps under perturbations pk → pk − θ , p1 → p1 + θ for θ > 0), then the β-CVaR is nonetheless continuous with respect to θ ≥ 0.
Note: since part (c) generalizes part (b), you will get full credit for this question if (a) and (c) are correctly answered and (b) is skipped. On the other hand, if you are more confident in your solution to (b) than to (c), then it is safer to submit (b) as well.
3. Suppose τ and x are two scalar variables in a portfolio optimization problem, where τ stands for a transaction cost and x stands for an invested amount. Suppose that one has the constraint τ ≥ ϕ(x), where
(a) Make a sketch of ϕ . You can either draw it by hand or use graphing software (like Matlab) or a graphing website. You will note from your sketch that ϕ is piecewise linear, continuous, and nonconvex. (This function ϕ is a model of transaction costs where there is a large per-unit expense for short selling, a smaller per-unit expense for ordinary purchasing, and a volume discount.)
(b) Provide a formula of the form ϕ(x) = max(· , min(· , ·)) that is equivalent to the above formula; each ‘·’ symbol stands for one of the three expressions appearing in the definition of ϕ .
(c) Using the min and max techniques described in lecture, introducing more variables as needed, rewrite the constraint τ ≥ ϕ(x) as an equivalent sequence of differentiable constraints, and explain how you arrived at your formula.
4. Consider the problem of minimizing xTHx/2 − tr(¯)Tx + tτ, where τ is a transaction cost for security 1 and t > 0 is the usual Pr3 parameter. Assume there is a wealth constraint, eT x = γ, where γ > 0 is the total budget; a no-short-sell constraint x ≥ 0; and a nonconvex piecewise linear transaction cost as written in lecture: τ ≥ 0.02α1 x1 + α2 (0.01x1 + 1000), α 1 + α2 = 1, α 1 ≥ 0, α2 ≥ 0.
(a) Eliminate the variable τ from the problem by inserting the expression on the RHS of the τ constraint into the objective function in place of τ . The problem variables are now x,α1 ,α2 .
(b) Show that the two new terms in the objective function introduced in part (a) can be written as a quadratic in standard form.
Here, G is a 3 × 3 symmetric matrix, h is a 3-vector, and d is a scalar; you should provide formulas for G, h, and d as part of your solution. Note: t > 0 is a constant.
(c) Argue that the matrix G derived in part (b) is not positive semidefinite. Suggested approach. The matrix G you found should have 0’s on the diagonal and nonzero entries in the nondiagonal entries of the first row. Use this structure to find a particular vector x ∈ R3 whose first two entries are nonzero such that xT Gx < 0.
5. Consider the following portfolio optimization problem in a universe with two securities:
min − r(¯)Tx + τ(x1 )
s.t. x1 + x2 = b,
x1 ≥ 0, x2 ≥ 0.
Take r(¯) = [1.10;1.05]. This question does not model risk, so it is assumed that both securities have very low risk.
Function τ is the transaction cost for x1 :
This cost is nonconvex because it models a volume discount. Security 2 has no trans- action cost.
(a) Consider the two investment strategies: (i) entire portfolio in security 1, and (ii)
entire portfolio in security 2. There is a particular value of b, say b(¯), such that for b > b(¯),
strategy (i) is preferred, while for b
the steps of your derivation.
(b) Rewrite the transaction cost as a min of two quantities. Then introduce two variables α 1 ,α2 as in lecture to model the transaction cost without explicitly taking a min. Thus, the problem will now have four variables, x1 , x2 ,α 1 ,α2 . Write down this new model. If you wrote it correctly, the constraints will consist of two linearequalities, four sign constraints, and an objective function with a mixture of linear and quadratic terms in the four variables.
(c) Implement in Matlab a script that invokes fmincon to solve the nonlinear con- strained optimization problem written down in (b) for values of b in the range 1000 : 200 : 3000 (i.e., 1000, 1200, 1400,..., 3000).
Some remarks on using fmincon for this problem: In your code, denote the optimization variable p, a 4-vector, for consistency of marking. The first two entries of p stand for x and the third and fourth entry for α 1 and α2 . You need to write a function handle (one-line function) for the objective function derived in (b). This function handle takes p as a variable and then computes the objective value in terms of p(1),..., p(4). This problem has no nonlinear constraints, so take nonlcon in the fmincon documentation to be []. There are two linear equality constraints, written using Aeq and beq in the documentation. There are lower bounds (denoted lb) but no upper bounds (denoted ub). Following the nonlcon argument in the argument list, include one more argument as follows:
[p,fval,exitflag] = fmincon( . . . , optimoptions(’fmincon’, ’Display’, ’off’))
This argument prevents fmincon from making a long printout as it solves the problem. The first return argument from fmincon is p, the solution for the four unknowns. The second return argument fval is unneeded. The third return variable exitflag should be checked on every iteration; if it is not equal to 1, then your program should emit an error message.
Set the x0 parameter for fmincon as follows. Use b/2 as the initial guess for both x(i)’s (first two entries of p), and 0.5 as the initial guess for the αi’s (last two entries of p).
For each value of b in the given range, solve the optimization problem to obtain p. Then display a line in the command window like this:
b = xxx x(1) = xxx x(2) = xxx
The Matlab statement to display a line like this is:
fprintf(’b = %f x(1) = %f x(2) = %f\n’, b, p(1), p(2))
Now repeat the whole procedure with an initial guess of p (i.e., x0) as follows: x(1) = b, x(2) = 0, α 1 = α2 = 0.5.
Did the optimizer found by fmincon correspond to the hand calculation in (a) as b varies? When I carried out this experiment, I found that the choice of starting guess made a big difference. This is expected since general-purpose nonlinear optimizers are sensitive to the choice of starting guess and may not return the true (global) minimizer for some starting guesses.
Hand in: a listing of your code, a copy of the output in the command window for the two cases (two starting guesses), and an answer to the question in the last paragraph.
Each printout should have 11 lines of the form b = xxx x(1) = xxx x(2) = xxx