Eric Zivot
CFRM 462/Econ 424
Summer 2015
Econ 424
Problem Set #7
Introduction to Portfolio Theory and Portfolio Theory with Matrix Algebra
Due: Tuesday 8/11/15 at 8 pm via Canvas

ReadingsMy lecture notes and class slides on introduction to portfolio theoryo portfolioFunctions.pdf
Ruppert, Chapter 11 (portfolio theory)
Tutorial on using Excel’s solver (on class web page)

Programs and Data

econ424lab7.r (on homework page)
introductionToPortfolioTheory.r
portfolioTheoryMatrix.r
introPortfolioTheory.xls
3firmExample.xls

Instructions
In this lab you willCompute portfolios consisting of Boeing and Microsoft, T-bills and Boeing, Tbills and Microsoft and T-bills and combinations of Boeing and Microsoft.
Use the solver and R functions to compute the global minimum variance portfolio
and the tangency portfolio
Use R and Excel to compute efficient portfolios using matrix algebra

Excel and R Exercises – Introduction to Portfolio Theory
The following questions require Excel and the Solver add-in (see the lecture notes for thecalculations using R). Organize your results in an Excel spreadsheet and submit thisspreadsheet as your homework. If you don’t have the Solver add-in, then you candownload a version from the class announcements page. If you can’t get the solver towork, then use R to answer the following questions. You will find the Excel spreadsheet
introPortfolioTheory.xls and introPortfolioTheory.r to be helpfulfor this assignment. Use R to check your answers in Excel.
The annual estimates of the CER model parameters for Boeing and Microsoft (based onmonthly data downloaded from Yahoo! And in the file lab7returns.csv on the classwebpage) are given below:> muhat.annual
rboeing
rmsft
0.1492271 0.3307664> sigma2.annual
rboeing
rmsft
0.06953347 0.136935> sigma.annual
rboeing
rmsft
0.263692 0.3700472> covhat.annual
rboeing,rmsft-0.0008089043> rhohat.vals
rboeing,rmsft-0.00828978
1. Create the following portfolios.
 Combinations of Boeing and Msft (with xboeing = -1, -0.9, …, 2 and xmsft = 1 –xboeing) Combinations of Boeing and T-bills (with xboeing =0, 0.1, …, 2)
 Combinations of Msft and T-bills (with xmsft = 0, 0.1, …, 2)
Use an annual risk-free rate of 3% per year for the T-bill. For each portfolio compute
E[Rp], var(Rp) and SD(Rp) using the appropriate formulas. For each portfolio plot
E[Rp] vs. SD(Rp) and put these values on the same graph. Compute Sharpe’s slopefor Boeing and Microsoft. Which asset has the highest slope value?
2. Compute the global minimum variance portfolio using the analytical formula
presented in class (see my R function globalMin.portfolio()), as well as thesolver.
 Make a pie chart showing the weight of Boeing and msft in global minimumvariance portfolio.

Compute E[Rp], var(Rp) and SD(Rp) for the global minimum variance
portfolio.
Compute Sharpe’s slope for the global minimum variance portfolio.
Indicate the location of the global minimum variance portfolio on the graph
you created previously in question 1.

3. Using a risk-free rate of 3% per year for the T-bill, compute the tangency portfolio
using the analytical formula presented in class (see my R function
tangency.portfolio() ) as well as the solver.
 Make a pie chart showing the weight of Boeing and msft in the tangencyportfolio.
 Compute E[Rp], var(Rp) and SD(Rp) for the tangency portfolio.
 Compute Sharpe’s slope for the tangency portfolio.
 Indicate the location of the tangency portfolio on the graph you createdpreviously in question 1.
4. Consider a portfolio that has 10% in the tangency portfolio and 90% in T-bills.
 In this portfolio, what is the percent invested in Boeing and what is the percent
invested in Microsoft? Give a pie chart showing the percent invested in T-bills,
Boeing and Microsoft.
 Compute E[Rp], var(Rp) and SD(Rp) for this portfolio.
 Compute Sharpe’s slope for this portfolio
 Indicate the location of the tangency portfolio on the graph you created previouslyin question 1.
5. Find the efficient portfolio (combination of T-bills and tangency portfolio) that has thesame risk (SD) as Microsoft (Hint: you do not need the solver for this).
 In this portfolio, what is the percent invested in Boeing and what is the percent
invested in Microsoft? Give a pie chart showing the percent invested in T-bills,
Boeing and Microsoft.
 Compute E[Rp], var(Rp) and SD(Rp) for this portfolio.
 Compute Sharpe’s slope for this portfolio
 Indicate the location of the tangency portfolio on the graph you created previouslyin question 1.
Excel and R Exercises –Portfolio Theory with Matrix Algebra
Using the monthly closing price data on the four Northwest stocks (Boeing, Microsoft,Nordstrom and Starbucks) over the period February 1995 - January 2000, you will
estimate expected returns, variances and covariances to be used as inputs to theMarkowitz algorithm. You will compute efficient portfolios allowing for short-sales. In
all cases, you will use matrix algebra formulas to simplify the running of the solver inExcel.
The script file econ424lab7.r walks you through the portfolio theory calculations usingthe R functions in the package IntroCompFinR. The Excel file 3firmExample.xls gives
a spreadsheet template for the portfolio calculations. Use this spreadsheet as a templatefor your analysis in this part of the lab. I want you to do all of the calculations in an Excel
spreadsheet. You can check your results using the R code.
Return data on Boeing, Nordstrom, Starbucks and Microsoft stock are in the Excel fileecon424lab7returns.csv on the class webpage.
In the following exercises you will use matrix algebra formulas to simplify thecomputation of efficient portfolios when there are more than two risky assets.
6. Using the return data on Boeing, Nordstrom, Starbucks and Microsoft in the matrix
ret.mat, estimate the parameters  i ,  i2 ,  i ,  ij and  ij of the constant expected return(CER) modelRit  i   it , t  1, , T it ~ iid N (0,  i2 )cov( it ,  jt )   ij
where Rit denotes the simple return on asset i (i = Boeing, Nordstrom, Starbucks, andMicrosoft). Compute estimated standard errors for the means and volatilities and briefly
comment. Arrange these estimates and standard errors nicely in a table.
7. Show the estimated risk-return tradeoff of these assets (i.e., plot the means on the yaxis and the standard deviations on the horizontal axis. Briefly comment.
a. Assuming a risk free rate of 0.005 (0.5% per month or about 6% per year)
compute the Sharpe ratios for each asset. Which asset has the highest Sharperatio?
8. Compute the global minimum variance portfolio allowing short-sales. The
minimization problem ismin  p2  mm subject tomm1  1
where m is the vector of portfolio weights and Σ is the covariance matrix. Briefly
comment on the weights. Compute the expected return and standard deviation andadd the points to the risk return graph.
9. Of the four stocks, determine the stock with the largest estimated expected return.
Use this maximum average return as the target return for the computation of anefficient portfolio allowing for short-sales. That is, find the minimum variance
portfolio that has an expected return equal to this target return. The minimization
problem ismin  p2  xx subject tomx   0x1  1
where x is the vector of portfolio weights, μ is the vector of expected returns and μ0 is
the target expected return. Are there any negative weights in this portfolio? Computethe expected return, variance and standard deviation of this portfolio. Finally,compute the covariance between the global minimum variance portfolio and theabove efficient portfolio using the formula cov(Rp,m, Rp,x) = m’Σx.
10. Using the fact that all efficient portfolios can be written as a convex combination of
two efficient portfolios, compute efficient portfolios as convex combinations of theglobal minimum variance portfolio and the efficient portfolio computed in question 3.
That is, computez =   m + (1- )  xfor values of α between 1 and -1 (e.g., make a grid for α = 1, 0.9, ..., -1). Compute theexpected return, variance and standard deviation of these portfolios.
11. Plot the Markowitz bullet based on the efficient portfolios you computed in theprevious questions. On the plot, indicate the location of the minimum variance
portfolio and the location of the frontier of efficient portfolio.
12. Compute the tangency portfolio assuming the risk-free rate is 0.005 (rf = 0.5%) per
month. That is, solvemax slope t p  rfsubject top

 p  t  p   t t 

1/ 2

1  t 1
where t denotes the portfolio weights in the tangency portfolio. Are there any
negative weights in the tangency portfolio? If so, interpret them.
13. On the graph with the Markowitz bullet, plot the efficient portfolios that arecombinations of T-bills and the tangency portfolio. Indicate the location of thetangency portfolio on the graph.