首页 > > 详细

Preliminaries

 0. Preliminaries

We will start by redoing some of the questions in Homework 3 that people had a harder time with.
 
In order to proceed you need Microsoft Excel and file "https://www.dropbox.com/s/yze3laidhv7gl1x/Homework4.xlsx?dl=1".
 
This file contains multiple sheets, you should use read_excel to get the the data that contains the 49 value-weighted industry portfolios.
 
See here:https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html .Use "sheet_name" to select the desired excel sheet.
 
In the sheet "market_proxy" there is a series with the market return and the risk-free rate. You should import that as well and merge with the 49 industry portfolios
 
HINT: Do not forget to treat the missing observations! Look at the data set before importing
 
1. Tangency portfolio
Find the tangency portfolios for these set of 49 portfolios. To do that you can simply apply the formula in Notebook 4 to you sample estimates of the EXCESS return moments.So the first step is to take out the risk-free rate. Also do not forget to omit the market and the risk-free rate when you cosntruct the weights!
 
Report the weights normalized so that they add up to 1.( It is important that when you do that the signs do not flip, so you should normalize by the absolute value of sum (W.sum().abs())
 
2. Minimum variance portfolio (MVP)
Find the MVP for these set of 49 portfolios.
 
Note that you cannot do that in excess returns any longer because excess returns are portfolios with price zero, so there is a trivial solution that minimizes the variance which is to set weigths equal to zero!This will trivially deliver a volatility of zero! But obviously not very intersting.
 
So how can you do this? First thing to recognize is that we have to minimize variance of a fully invested portfolio, i.e. a portfolio that costs 1 dollars. So we need to the mimization using returns.So while the tangency portfolio solves
 
min𝑉𝐴𝑅(𝑊′𝑅𝑒) 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝐸[𝑊′𝑅𝑒]=𝜇
where 𝑅𝑒 is the vector of portfolios excess returns 𝑅𝑒=𝑅−𝑟𝑓, the minimum variance portfolio solves
 
min𝑉𝐴𝑅(𝑊′𝑅) 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑊′1=1
where 𝑅 are returns and 𝑊′1=1 is a contraint that makes the weights add up to 1
 
As we discussed in class, the solution to problem 1 has the form
 
𝑊𝑇𝑎𝑛𝑔𝑒𝑛𝑐𝑦=𝐸[𝐸𝑒]@𝑉𝑎𝑟(𝑅𝑒)−1
Where 𝑉𝑎𝑟(𝑅𝑒) is the variance-covariance matrix of excess returns and 𝑉𝑎𝑟(𝑅𝑒)−1 is it's inverse, which we can find by using the numpy function np.linalg.inv() as shown in notebook 4.
 
Now note how similar the two problems are! If you look at it carefully you see that if you get problem 1 and replace 𝑅𝑒 with 𝑅, 𝐸[𝑅𝑒] to a vector of 1's, and 𝜇 with 1. Thus the solution to problem 2 is simply given by
 
𝑊𝑀𝑉𝑃=1@𝑉𝑎𝑟(𝑅)−1
Where 1 above is a vector of 1 that that has the same dimension as as the number of assets.
 
Report the weights that you find
联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!