Implement the index tracking portfolio

Assignment Help Python Programming
Reference no: EM132833986

Problem 1: Practice with CVX

(a) Suppose we have the following optimization problem:

maximize Σmi=1 -wilog wi
subject to w ≥ 0, Σmi=1 wi = 1, XTw = b

where w ∈ Rm, X ∈ Rmxn and b ∈ Rn. Given that m = 20 and n = 10, we can generate the data for X and b as follows:

m <-20
n <- 10
set . seed (22)
X matrix (rnorm(m*n) ,m, n)
b <- t (X) %*% as. vector ( rep (1 /m, m)) + rnorm(n, 0, 0.005)

Solve this problem, show the code and optimal value of w*.

(b) Solve the following optimization problem

minimizex∈Rm,y∈Rm Σmi=1 yi

subject to x1 = 0, xm, = 1, y1 = 1, ym = 1,
(xi+i - xi)2 + 2(yi+1 - yi)2 ≤ 0.022, i = 1,.....,m - 1

Set m = 101, plot the curve of (x, y), which consists of a series of points (x1, y1), ,(x101, y101).

Problem 2: Portfolio optimization

In this problem, we aim at designing portfolios among following assets:

StocksArray = c('MSFT',' AAPL',' AMZN',' GOOGL',' JNJ',' JPM', 'UNH',' MA',' HD',' INTC','VZ',' K0',' BAC',' X0M',' MRK',' DIS', 'PEP',' CMCSA',' CV X',' ADBE',' CSCO',' NVDA','WMT',' NFLX', 'WFC',' MCD',' ABT',' BMY',' COST' BA',' C',' PM',' NEE',' MDT', 'AMGN','TM0',' LLY',' HON',' ACN',' IBM')

The period we consider is from 01-01-2010 to 31-12-2020. We will use the R package 'portfolioBacktest'. Please check the vignette before answering the questions.

(a) Prepare your data set for backtest. In R, you should create a specified list, resample it into 50 different sub-lists, each of which contains 20 stocks and 252 x 2 days' prices. Hint: use the function 'stockDataDownload' to get the data, then use 'financialDataResample' to resample the data set. (N_sample = 20,T-sample = 252 . 2, num_datasets = 25.)

data <- stockDataDownload ( stock _symbols = StocksArray )

(b) Implement Markowitz portfolio with max position constraint:

minimizew -wTμ + λwTΣw
subject to ||w|| ≤ μ, 1Tw = 1, w ≥ 0,

where μ and Σ can be estimated by sample mean and sample covariance matrix. Set λ = 2 and u = 0.04. Do the backtest, show the performance table and compare it with standard Markowitz portfolio (without max position constraint).

(c) Consider a portfolio formualted as

minimizewTw - ∈||W||
subject to w ≥ 0, 1Tw = 1,

where μ can be estimated by sample means. Try to determine the value of ∈, do the backtest, then show the performance table.

(d) Instead of using sample meanµ and sample covariance matrix Σ to construct the portfolio, here we would use

Σ = ρ1Σ + (1 - ρ1) trace(Σ)IN/N

μ = ρ2μ + (1 - ρ2)1.TNμ/N.1N

where N is the number of asset and IN is the identity matrix of order N. Use all possible pairs for ρ1 and ρ2 in {0, 0.25, 0.5, 0.75, 1), do the backtest for the mean-variance portfolio

minimize -wTμ, + λwTΣw

subject to w ≥ 0, 1Tw = 1,

under all possible combination of ρ1 and ρ2, ( λ= 0.01), show the performance table and tell which pair of (ρ1, ρ2) gives the best Sharpe Ratio performance.

(e) Implement the index tracking portfolio by simply regressing the dense index

minimize 1/T||rb - Xb||22

subject to 1Tb = 1, b ≥ 0.

Do the backtest and show the performance table. (Check the slide for the notations in this sub-problem.)

Problem 3: Gradient descent

Consider an unconstrained optimization problem:

minimize f(x) = ex1+3x2-0.1 + ex1 -3x2 -0.1 + e-x1 -0.1

Design a gradient descent method for solving it. You should clearly define the starting point, step size, and stopping criteria. Check whether your results converge to the optimal using CVX.

Reference no: EM132833986

Questions Cloud

Explain the direct stakeholders of a company : Paula, the CEO of a small consulting firm, told her subordinates that the company is only interested in making money for the shareholders since
Which terms is defined as the volatility of an investment : Costs 9.95 dollars per stock trade. How much money do you need to buy 100 shares of Ralph Lauren (RL), which trades at 85.13 dollars?
What is the expectation for company to hire mba : What is the expectation for company to hire bachelor degree computer science graduate in real life?
Difference between living by faith and living by sight : What is the difference between living by faith and living by sight? How an employee can live by faith instead of sight on a daily basis.
Implement the index tracking portfolio : Implement the index tracking portfolio by simply regressing the dense index and Design a gradient descent method for solving it.
When will the changes take place : Who will be impacted in the organization? For those impacted, how will their positions change? What will the specific changes be? When will the changes take.
What is the composition of the dow jones industrial average : As residual claimants, which investors claim any cash flows to the firm that remain after the firm pays all other claims? Bondholders.
How has the company used horizontal mergers : Merger and acquisition strategies typically set sights on achieving any of five objectives:
What is the price paid to the bondholder : Call premium of one year of coupon payments. Assuming a par value of 1,000 dollars, what is the price paid to the bondholder, if the issuer calls the bond?

Reviews

len2833986

3/20/2021 12:54:26 AM

I need help on the questions. Need speedy delivery with accurate and clear solution. Please read the questions clearly.

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd