Question: Python: Problem 1 In Modern Portfolio Theory, one is interested in allocating a certain amount of mweoney into a set of N stocks. The portfolio

Python:

Python: Problem 1 In Modern Portfolio Theory, one is interested in allocatinga certain amount of mweoney into a set of N stocks. Theportfolio W E RN is the normalized money invested in each stocksuch that the sum of this N dimensional vector is 1. This

Problem 1 In Modern Portfolio Theory, one is interested in allocating a certain amount of mweoney into a set of N stocks. The portfolio W E RN is the normalized money invested in each stock such that the sum of this N dimensional vector is 1. This allocation process is formulated as the following optimization problem: maximize w - ww W subject to w > 0, wT1 = 1, where u is the given vector of expected stock returns, and is the given covariance matrix of the stock returns. The objective consists of two components. w'u is called portfolio expected return, and wTEw is called portfolio variance. Intuition of our objective is maximizing the money we earn minus the risk we take. 2 is a trade-off parameter that controls how much the investor values the portfolio variance over the portfolio expected return. The solution to the above problem, w*, is often called the "Markowitz portfolio" or the "Mean-variance portfolio." (a) Argue whether this problem is convex or not. (b) Write a piece of code in Python and use CVXPY package' to solve the above problem given the following values of "If you are still confused about the proper use of CVXPY, check the official document or a brief Aum API (a) Argue whether this problem is convex or not. (b) Write a piece of code in Python and use CVXPY package' to solve the above problem given the following values of a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} x 10-2, with the following values of and u: 1 If you are still confused about the proper use of CVXPY, check the official document or a brief summary 1.0 0.0015 -0.02 = 0.0015 1.0 -0.1 -0.02 -0.1 1.0 u = [0.001,0.05, 0.005]T For each solution wt, compute the following quantities Portfolio Expected Return(2) = wi" 1 Portfolio Volatility(1) = \ w* 'Ew. Create a curve plot Portfolio Expected Return versus Portfolio Volatility. Create a plot containing the following three curves: 1. The first element of w* versus 1 (c) Create a plot containing the following three curves: 1. The first element of wat versus 2 2. The second element of w versus a 3. The third element of wat versus 2 Explain why the wo has this distribution; why the portfolio has this changing pattern when 2 increases; and what will happen when 2 is pretty large. Hint: We don't require your mathematical calculation here since you will learn about portfolio details in the coming lectures. Think about how most investors act when they know each stock's expected return and the varying risk. The curve in (b) gives you some ideas. (d) Evaluating a set of portfolios with different l's is necessary to choose the optimal hyperparameter (also called hyperparameter tuning). There are two main methods to conduct this repetitive evaluation. Method 1: Reconstruct the entire problem and plug in a new a repeatedly, i.e., each problem is independent. Method 2: Use the CVXPY parameters function and only define the problem once? 2 See parameters for details. Please finish the following tasks: 1 Implement both methods for (b) You might have already (d ) Evaluating a set of portfolios with different l's is necessary to choose the optimal hyperparameter (also called hyperparameter tuning). There are two main methods to conduct this repetitive evaluation. Method 1: Reconstruct the entire problem and plug in a new a repeatedly, i.e., each problem is independent. Method 2: Use the CVXPY parameters function and only define the problem once? 2 See parameters for details. Please finish the following tasks: 1. Implement both methods for (b). You might have already implemented one. Print the w* 's of both methods and ensure 0.15 that they are the same. 2. Compare their speeds: How many times faster is the second method than the first method in this example? Observation #1: Make sure to write your code in a modular, readable way. Code organization will be taken into account for the grading. Use meaningful names for variables, create functions to organize your code as much as possible. In case of doubt on coding best practices, take a look at the Google's style guide. Note that you don't have to strictly follow that style, you can develop your own, but make sure it is understandable and you use it consistently

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!