Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Project 2: The Capital Asset Pricing Model and Portfolio Theory

Note: Please work in the same group that you established for Project 1.

Overview
In Part I, you will retrieve financial data and calculate stock returns and betas. In Part II, you will
calculate portfolio returns and betas. In Part III, you will conduct a mean-variance analysis and construct
an efficient frontier.

Part I: Retrieve Financial Data and Calculate Stock Returns and Betas

A. Data Gathering
1. Pick five publicly traded firms that you are interested in analyzing. If you are not using Bloomberg,
then apply the same data-gathering method that you used in Project 1 (this time downloading only the
most recent six years of stock price data). If using Bloomberg, use the blue search bar to find your first
stock’s ticker symbol. For example, if you type in Apple, under the heading SECURITIES the first item
is ‘AAPL US Equity.’ This is Apple’s Bloomberg ticker symbol.

2. In cell A2 of a blank worksheet enter:

=BDH(B1,"px last","-72cm","","per=m","fill=error","days=a","sort=d"),

where -72cm pulls up the most recent 6 years’ closing prices.

3. In cell B1 enter the Bloomberg ticker symbol that you recovered from step 2. In cell C1 enter the
ticker of the next stock that you want to examine. Copy and paste the formula from cell A2 into cell B2.
Modify this formula by changing the ‘D1’ to a ‘C1’ and adding "dts=h" to the end of the formula, which
will prevent the system from adding a column of redundant dates. Copy and paste the formula from C2
into D2 through I2. Finally, enter ticker symbols into cells D1, through I1. The tickers for cells D1
through F1 will be those for whatever stocks you choose, those for G2, H2, and I2 will be for the Dow
Jones Industrial Average, S&P500 Index, and NASDAQ Composite Index, and that for J2 will be the 30-
year Treasury yield. Freeze the top row and first column. Name this worksheet ‘Price Summary’ and
save your file as Project 2.

Page 1 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

B. Calculate Returns
Create a new worksheet titled ‘Annual Returns Summary.’ In the first column, label the first row ‘Date,’
label the next five columns ‘ΔXYZ’ where XYZ is the ticker symbol for each stock. Label the final four
columns ‘ΔDJIA,’ ‘ΔS&P500,’ ‘ΔNASDAQ,’ and ‘rf.’ Link the dates to those from the ‘Price Summary’
worksheet. Convert the monthly stock prices on ‘Price Summary’ into annualized returns by applying the
transformation ∆X = Xt/Xt-12 – 1. Delete all rows for which you do not have valid returns observations.
Convert the Treasury data into rates by dividing by 100 and formatting as a percentage. Freeze the top
row and first column.

C. Calculate Betas
Use annualized returns to calculate the betas for each of the stocks relative to each of the three indexes.
There are three acceptable regression specifications for estimating beta: ri = αi + βirm, ri = αi + βi(rm – rf),
and (ri – rf) = αi + βi(rm – rf). Note that in each specification, αi is the intercept, which measures the
excess return, and βi is the slope. Beta is labelled ‘X Variable 1’ in Excel’s regression output.

Initially, we will use the first regression specification, ri = αi + βirm.

1. On the Data tab choose ‘Data Analysis’ and select ‘Regression.’ If you do not see the Data Analysis
option under the Data tab, go to File, Options, Add Ins, and select Go. From there fill in the Analysis
ToolPak and Analysis ToolPak – VBA dialog boxes and then press Ok.

2. Input the Y range (the annualized returns of a stock).

3. Input the X range (annualized DJIA returns).

4. Under Output options select ‘New Worksheet Ply,’ and click ‘OK.’

5. Repeat the procedure for the same stock using each of the other two indexes. Cut and paste the three
regression outputs into a worksheet called ‘ABC Betas’ where ABC is the name of your first stock. On
this worksheet place a label next to each regression output as follows: ‘ABC/Index’ where Index is the
name of the equity index used in the regression. Repeat the procedure for each of the four other equities.

Page 2 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

You will run a total of 15 regressions and create a total of 5 betas worksheets.

6. Create a new worksheet called ‘Betas Summary.’ Your table should be formatted as follows:

7. Fill in the ‘Regression Betas’ section by linking to the associated regression outputs. Remember that
beta is labelled X Variable 1 in the regression output. The cells for ‘Portfolio 1’ and ‘Portfolio 2’ will
remain blank for now.

8. In the section labeled ‘Variance/Covariance Betas,’ compute the betas for each of the three indexes for
σ im
each stock that you have selected using the formula β i = , where σ m2 is the variance (VAR.P) of
σ m2
market returns and σ im is the covariance (COVARIANCE.P) of the returns of stock i with the returns of
the market. These betas should exactly match your regression betas.

You should now have the following worksheets in this order:

a. Price Summary
b. Annual Returns Summary
c. ABC Betas
d. DEF Betas
e. GHI Betas
f. JKL Betas
g. MNO Betas
h. Betas Summary

Page 3 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

Part II: Calculate Portfolio Returns and Betas

A. Portfolio Returns
1. In the ‘Annual Returns Summary’ worksheet, create two columns titled ‘ΔPortfolio 1’ and ‘ΔPortfolio
2.’ For ‘ΔPortfolio 1,’ each month calculate the average of the annualized returns of all five stocks. This
column represents the returns of an equally-weighted portfolio.

2. Create a new worksheet titled ‘Portfolio 2 Value.’ The worksheet should have two columns. The first
column will be the date (referenced from your ‘Price Summary’ worksheet) and the second column,
labeled ‘Portfolio 2 Value,’ will be the sum of your five stock prices for that month.

3. In the ‘ΔPortfolio 2’ column on the ‘Annual Returns Summary’ worksheet, use the values that you
calculated in the ‘Portfolio 2 Value’ worksheet to calculate annualized returns. This column represents
the returns of a value-weighted portfolio.

4. On the ‘Annual Returns Summary’ worksheet calculate the total holding period return, geometric mean
annual return, population standard deviation, skewness, and kurtosis for each asset. Note that you will
not be able to calculate the THPR or the geometric mean annual return for the Treasury or Portfolio 1.
You can, however, substitute the arithmetic mean return using the Average function.

B. Portfolio Betas
1. Using the ‘Annual Returns Summary’ worksheet, calculate regression and variance/covariance betas
for each of the two portfolios using each of the three market indexes. Put the regression output into two
new worksheets titled ‘Portfolio 1 Betas’ and ‘Portfolio 2 Betas’ and complete the table within ‘Betas
Summary.’

2. Create a new worksheet labeled ‘Portfolio 2 Alt Specs’ (short for Alternative Specifications).

a. Create columns ‘Date,’ ‘rf,’ ‘ΔS&P500,’ and ‘ΔPortfolio 2’ by linking to the ‘Annual Returns
Summary’ worksheet. Link the cells below this row to the appropriate dates and returns.

Page 4 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

b. Create column ‘MRP,’ which is the difference between the annual S&P500 return and the 30-
year Treasury yield.

c. The last column is the difference between Portfolio 2’s annualized return and the 30-year
Treasury rate. Label this column ‘Portfolio Premium.’

3. On the ‘Portfolio 2 Alt Specs’ worksheet, run a regression as follows: rportfolio2 = αportfolio2 + βportfolio2(rm –
rf). The dependent variable is annualized Portfolio 2 returns and the independent variable is the market
risk premium. Set the output range to an available space to the right on the same worksheet, and title the
output ‘Alt Spec 1.’

4. Run another regression as follows: (rportfolio2 – rf) = αportfolio2 + βportfolio2(rm – rf). The dependent variable
is now the portfolio premium. Set the output range to an available space to the right on the same
worksheet, and title the output ‘Alt Spec 2.’

C. SML
1. Create a new worksheet and label it ‘SML Plot.’

a. Create three columns of data: ‘Equity,’ ‘S&P500 Beta,’ and ‘Average Return.’

b. Link ‘S&P500 Beta’ to the S&P500 betas in ‘Betas Summary.’

c. For each of your stocks and portfolios, link ‘Average Return’ to the average annual returns that
you calculated at the bottom of your ‘Annual Returns Summary’ worksheet. Your data should
now be formatted as follows:

2. Run a regression between the average return (the dependent variable) and the S&P500 beta estimates
(the independent variable). In the regression dialog box, check ‘Line Fit Plot’ and set the output range to
an available space to the right on the same worksheet. Increase the size of the plot by clicking on a corner
and dragging it. Right-click the predicted y values and from the menu add a linear trend line. Label the x
and y axes and give the plot a title.

Page 5 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

You should now have the following worksheets in this order:

a. Price Summary
b. Annual Returns Summary
c. ABC Betas
d. DEF Betas
e. GHI Betas
f. JKL Betas
g. MNO Betas
h. Betas Summary
i. Portfolio 2 Value
j. Portfolio 1 Betas
k. Portfolio 2 Betas
l. Portfolio 2 Alt Specs
m. SML Plot

Page 6 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

Part III: Mean-Variance Analysis

A. Variance-Covariance Matrix
1. Go to the ‘Annual Returns Summary’ worksheet.

2. Go to Data -> Data Analysis -> Correlation.

a. Highlight the annualized returns for your stocks, including the column labels, and put these in
the ‘Input Range.’

b. Check the ‘Labels in First Row’ and ‘New Worksheet Ply’ boxes. Enter ‘Variance-Covariance
Matrix’ in the ‘New Worksheet Ply’ box and click OK.

c. Complete the construction of the correlation matrix using the TRANSPOSE function. For
example, select cells C2 through F2, type =transpose, select cells B3 through B6, hold shift and
control simultaneously, and then press enter. Note that you must use the TRANSPOSE function
precisely as described here. If you manually transpose your data you will find that you have to
start all over again later in the project. Repeat this transpose operation until you have filled in all
of the blanks with transposed values. Format all of the correlation cells as a number with four
decimal places.

d. Create a new bottom row and link each cell to its respective population annual standard
deviation from the ‘Annual Returns Summary’ worksheet. Then, using the TRANSPOSE
function again, insert a column vector that contains the transpose of these standard deviations (σ')
to the right of the matrix. Format the standard deviations as a percentage with two decimal
places.

e. Below this create a new table titled ‘Variance-Covariance Matrix.’ This matrix is represented
by the Greek symbol Σ.

i. Each element in Σ is σxy, and is calculated as σxy = ρxy*σx*σy. For example, in the
matrix below, the calculation for cell B12 is -0.1876 * 0.3376 * 0.2252 = -0.0143. An
easy way to complete the table is to multiply while anchoring horizontal standard
deviation row (σ) and the vertical standard deviation column (σ').

Page 7 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

ii. At the bottom of Σ create a row of equal weights (this is the w row vector) by
manually inputting 0.20 in each cell. In the right-most cell, use the SUM function to add
these cells together (do not simply enter the value 1 as this will cause problems later).

iii. To the right of Σ, create a column vector of weights using the TRANSPOSE function.
This is the w' column vector.

iv. To the right of w' created in iii, create a column vector of returns by using the
TRANSPOSE function and linking to the mean annual return of each stock in the
‘Annual Returns Summary’ worksheet. This is the Return column vector.

v. In the row below the weights that you created in ii, create row wΣ. Use MMULT to
multiply the w row vector by the Σ matrix. Your table should now be formatted as
follows:

f. Beneath the Variance-Covariance Matrix create a table formatted as follows:

Page 8 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

i. Variance is calculated as wΣw'. Since wΣ is already calculated, you just need to


multiply wΣ by w'.

ii. Calculate standard deviation as the square root of variance.


N
iii. The expected return of the portfolio is r̂P = ∑ w r̂ , or the multiplication of the w row
i =1
i i

vector by the Return column vector.

B. Construct an Efficient Frontier


1. Use Excel’s Solver function to manipulate asset weights and construct an efficient frontier.

a. Go to Data -> Solver.

b. Link ‘Set Objective’ to the variance cell in the Solver Values table. Select the ‘Min’ option, as
we are trying to minimize our portfolio’s variance.

c. Set the ‘By Changing Variable Cells’ to the cells in the w row vector.

d. To use the ‘Subject to the Constraints,’ click the ‘Add’ button. The ‘Cell Reference’ is the
portfolio weight check cell (the cell you created to verify that the weights add to 100%). Set this
cell equal to one.

e. Set a second constraint that forces the return to be -0.05.

f. Uncheck ‘Make Unconstrained Variables Non-Negative’ and click ‘Solve.’ This will bring up
the ‘Solver Results’ box.

g. Check ‘Return to Solver Parameters Dialog,’ click ‘Save Scenario,’ name the scenario ‘-0.05,’
and click ‘OK.’

h. Repeat steps e through g replacing the return constraint with 0, 0.05, 0.10, 0.15, 0.20, 0.25,
0.30, 0.40, then 0.50 using the ‘Change’ button.

2. In the Data tab, click the drop-down labeled ‘What-If Analysis.’

a. Click ‘Scenario Manager.’ This will bring up a dialog box. The ‘Scenarios’ cell should contain
the names that you previously saved.

b. Click ‘Summary’ and set ‘Result cells’ to ‘X,Y’ where X is your ‘Standard Deviation’ cell and
Y is your ‘Return’ cell. This will create a ‘Scenario Summary’ worksheet.

c. Go to the ‘Scenario Summary’ worksheet and rename it ‘Mean-Variance Scenarios.’ If you


entered your scenarios in ascending order, the data in this worksheet should be horizontally sorted
by ascending returns.

3. Create a scatter plot (with smooth lines and markers) of expected returns (vertical axis) vs. standard
deviation (horizontal axis). Your plot should be shaped like the letter ‘C’ (do not include the return or
standard deviation values from column D on your plot). Move this plot to a new worksheet titled
‘Efficient Frontier Plot,’ and label the plot accordingly.

Page 9 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

4. Overlay on this plot the mean return and standard deviation of each stock from the ‘Annual Returns
Summary’ worksheet.

a. Right-click on the chart and pick Select Data and then Add.

b. Go to your ‘Annual Returns Summary’ worksheet and select the return and standard deviation
of one of your stocks. Enter an appropriate series name (the name of your company).

c. Repeat this procedure for the remainder of your stocks and two portfolios. Insert a legend and
label the curved line from the scatter plot ‘Efficient Frontier.’ If you have done everything
correctly each overlaid data point will end up to the right of the efficient frontier.

Efficient Frontier
60%

50%

40%
Efficient Frontier
Apple
30%
Return

Toyota
Bank of America
20%
Berkshire B
Contrafund
10%
Portfolio 1
Portfolio 2
0%

-10%
0% 10% 20% 30% 40% 50% 60% 70%

Standard Deviation

You should now have a completed set of worksheets in this order:

a. Price Summary
b. Annual Returns Summary
c. ABC Betas
d. DEF Betas
e. GHI Betas
f. JKL Betas
g. MNO Betas
h. Betas Summary
i. Portfolio 2 Value

Page 10 of 11
Project 2: The Capital Asset Pricing Model and Portfolio Theory

j. Portfolio 1 Betas
k. Portfolio 2 Betas
l. Portfolio 2 Alt Specs
m. SML Plot
n. Variance-Covariance Matrix
o. Mean-Variance Scenarios
p. Efficient Frontier Plot

Page 11 of 11

You might also like