Fin 351
Project 2
Derivation of the Efficient Frontier
Part 1
1. Log into WRDS (Wharton) database, using the following information:
Userid: sseechar
Pwd: Plza.123
a. Choose CRSP (Center for the Research of Security Prices) database
b. Choose North America
c. Choose Equities
d. Choose Monthly data files
2. Download data on monthly returns (choose Holding Period Return variable) for the most recent 5-year period on four companies (or mutual funds, ETFs, etc.) from CRSP database into the Excel file. Choose companies from unrelated industries. Use your common sense here. For example, computer hardware and software industries are closely related, but computer hardware and food industries are not. Make sure that your dates are consistent across all four stocks, i.e. you select returns for the same 5-year period.
You can download similar data from Bloomberg
3. Using commands in the Excel Functions menu (click on fx button), calculate expected monthly returns on all three stocks (use AVERAGE function), their variances (VAR function), standard deviations (STDEV function), arrange them into variance-covariance matrix.
The more efficient way to calculate the variance-covariance matrix is using cov-matrix.xlam application, posted on BB. You need to download this application onto your computer and then open it within your Excel program. Don’t forget to enable macros.
In this example, Variance-Covariance is a 4 by 4 table. Suppose that it is located in cells (C98:F101), that is rows 98 through 101, columns C through F. On the diagonal of this matrix are variance estimates, on off-diagonal are covariance terms (we will use these addresses later in mmult command).
4. Now find the correlation coefficient between each pair of companies (CORREL function). Arrange them into the 4 by 4
· Correlation matrix
5. Annualize expected returns, variances and covariances. It means you have to multiply monthly expected returns, variances and covariances by 12. We can do this because we assume markets to be efficient at least in a weak form. Market efficiency means that monthly returns are independent of each other; that is the correlation coefficient between returns in one month and returns in any other month is 0. The annual standard deviation is just the square root of the annual variance. The annual correlation coefficient is the same as the monthly correlation coefficient.
You can multiply the entire variance-covariance matrix by 12. Below is the link to the excellent tutorial on matrix manipulations in excel:
http://facweb.cs.depaul.edu/mobasher/classes/csc575/assignments/MatrixOperations-Excel2007.pdf
6. Report monthly and annual statistics, calculated in (3) -- (5). Present annualized variances and covariances in the variance-covariance.
Part 2
7. In the next four columns specify weights of the four stocks in your portfolio. Remember, that the weight of the forth stock in the portfolio can be expressed as w4 = 1- w1 – w2– w3. Alternatively, ...
Hybridoma Technology ( Production , Purification , and Application )
Fin 351Project 2Derivation of the Efficient Frontier Part .docx
1. Fin 351
Project 2
Derivation of the Efficient Frontier
Part 1
1. Log into WRDS (Wharton) database, using the following
information:
Userid: sseechar
Pwd: Plza.123
a. Choose CRSP (Center for the Research of Security Prices)
database
b. Choose North America
c. Choose Equities
d. Choose Monthly data files
2. Download data on monthly returns (choose Holding Period
Return variable) for the most recent 5-year period on four
companies (or mutual funds, ETFs, etc.) from CRSP database
into the Excel file. Choose companies from unrelated industries.
Use your common sense here. For example, computer hardware
and software industries are closely related, but computer
hardware and food industries are not. Make sure that your dates
are consistent across all four stocks, i.e. you select returns for
the same 5-year period.
You can download similar data from Bloomberg
3. Using commands in the Excel Functions menu (click on fx
button), calculate expected monthly returns on all three stocks
(use AVERAGE function), their variances (VAR function),
2. standard deviations (STDEV function), arrange them into
variance-covariance matrix.
The more efficient way to calculate the variance-covariance
matrix is using cov-matrix.xlam application, posted on BB. You
need to download this application onto your computer and then
open it within your Excel program. Don’t forget to enable
macros.
In this example, Variance-Covariance is a 4 by 4 table. Suppose
that it is located in cells (C98:F101), that is rows 98 through
101, columns C through F. On the diagonal of this matrix are
variance estimates, on off-diagonal are covariance terms (we
will use these addresses later in mmult command).
4. Now find the correlation coefficient between each pair of
companies (CORREL function). Arrange them into the 4 by 4
· Correlation matrix
5. Annualize expected returns, variances and covariances. It
means you have to multiply monthly expected returns, variances
and covariances by 12. We can do this because we assume
markets to be efficient at least in a weak form. Market
efficiency means that monthly returns are independent of each
other; that is the correlation coefficient between returns in one
month and returns in any other month is 0. The annual standard
deviation is just the square root of the annual variance. The
annual correlation coefficient is the same as the monthly
correlation coefficient.
You can multiply the entire variance-covariance matrix by 12.
Below is the link to the excellent tutorial on matrix
manipulations in excel:
http://facweb.cs.depaul.edu/mobasher/classes/csc575/assignmen
ts/MatrixOperations-Excel2007.pdf
3. 6. Report monthly and annual statistics, calculated in (3) -- (5).
Present annualized variances and covariances in the variance-
covariance.
Part 2
7. In the next four columns specify weights of the four stocks in
your portfolio. Remember, that the weight of the forth stock in
the portfolio can be expressed as w4 = 1- w1 – w2– w3.
Alternatively, you can write a weight constraint into the next
column
You can use any set of numbers as a starting point.
8. In the next three columns enter the formula for the variance,
standard deviation and expected return (in that order) of the
portfolio of four stocks:
(1)
(2)
(3)
4. The more efficient way to do calculate the variance or the
portfolio and its expected return is to use matrices:
We will use the following matrix form for this equation:
(4)
In equation (4), denotes 1 by 4 row vector of weights, stands
for 4 by 4 variance-covariance matrix, and ’ is a transpose of , a
4 by 1 column vector of weights.
a. To do this in Excel:
(i) Enter the vector (row of four) weights for the four assets, for
example in B109:E109. You can start from any set of numbers.
In the next cell (F109) Enter the weight constraint, i.e. enter the
formula:
=SUM(B109:E109).
(ii) Now use the following command in Excel to perform
matrix multiplication to find the variance of your portfolio
=MMULT(MMULT(B109:E109,$C$98:$F$101),TRANSPOSE(B
109:E109))
Press simultaneously CTRL-SHIFT and while holding these two
keys, also press ENTER. Suppose that the result of your
operation is located in cell G109.
9. Copy everything 10 times (next ten rows).
10. Use Solver to find the weights of the minimum variance
efficient (MVE) portfolio of your four chosen stocks in the first
row. To do this, you simply minimize the variance of the
portfolio, no constraints on the expected return of the portfolio
needed.
5. Steps:
a. Go to Data, find Analysis and click on Solver
b. In Solver window, in “Set Objective”, enter G109 (this is
where you have your variance function) and click on Min. Your
objective is to minimize the variance of the portfolio.
c. In “By Changing Cells” enter the range of weights that Solver
can change, i.e B109:E109.
d. Add the constraint on weights: reference cell F109 (sum of
all four weights) should be equal to 1.
e. Click OK.
f. In the next cell, H109, find the annualized standard deviation
of the MVE portfolio.
11. Calculate the expected return on the MVE portfolio. In
matrix form this equation is:
(5)
In (5) stands for the 1 by 4 row vector of expected returns and ’
is a column vector of weights.
To do this in Excel, in cell I109 write:
=MMULT($B$92:$E$92,TRANSPOSE(B109:E109))
where the first array of cells contains annualized expected
returns on individual hedge fund strategies. Done forget to press
simultaneously CTRL-SHIFT and while holding these two keys,
also press ENTER.
12. Use Solver to calculate efficient portfolios for each level of
6. expected returns. That is, increase expected returns above the
level of E[RMVE] in small increments (for example, the next
portfolio’s expected return would be 1% higher than the
expected return on the MVE portfolio). This new return enters
Solver as your constraint. You need to find a portfolio that has
the smallest possible standard deviation and pays your chosen
expected return. Mathematically, you solve the following
optimization problem:
(6)
subject to:
E[Rp] = A,
where A is your chosen expected return.
You will need to repeat your optimization with Solver 10 more
times, each time increasing return by 1%. Don’t use paste and
copy at this point.
In Solver, the steps are exactly the same as in Step 10, except
that in the “Subject to constraints” window, you now need to
enter the return constraint. Click on “Add”. The constraint
window will open. In the “Cell Reference”, enter I110 (in our
example the expected return on the next portfolio is located in
this cell) and choose =. In the “Constraint” enter =I109+0.01.
This means that return on your next portfolio should be equal to
the return on MVE plus 1%. Click on “OK.”
13. Use Chart menu in Excel to draw the graph of the efficient
frontier: expected return (on Y-axis) versus standard deviation
(on X-axis). Use XY plot.
12. Scanned by CamScanner
Scanned by CamScanner
FIN 355 Prof. GershunPage 1
Tutorial for Solver
Portfolio Theory and Management
To define a problem in Solver, you need to follow these
essential steps:
Choose a spreadsheet cell to hold the value of each decision
variable in your model.
Create a spreadsheet formula in a cell that calculates the
objective function in your model.Similarly, create formulas in
cells to calculate the left hand sides of your constraints.Use the
dialogs in Excel to tell the Solver about your decision variables,
objective and constraint calculations, and desired bounds on
constraints and variables.Click Solve in Excel to find the
optimal solution.
Example 1: Constructing a Portfolio of Bonds with the Targeted
Duration
You need to create a portfolio with the duration equal to 4 years
using three bonds. Use 3 bonds described in problem 2.19 from
you Bond Homework Set. The total value of the portfolio is $1
million.
Solution
13. Step 1: Enter prices of all three bonds in one column (say B2 to
B4). Enter their durations in the other column (D2 to D4).
Step 2: In the column named "N of bonds" (E2 to E4) enter any
3 numbers (you can start with 1, 2, and 3).
Step 3: Enter the formula for the value of the portfolio (this is
cell B7 in this example).
Step 4: Enter formulas for the three weights (cells B10 to B12
in this example).
Step 5: Enter the formula for the sum of weights (cell B13).
Step 6: Enter the formula for the duration of the portfolio (cell
E10).
Now start Solver:
Position your cursor in the target cell (the cell where you
entered the formula for the duration of the portfolio). Choose
Solver from the Tools menu. The main Solver window will
open.
You need the duration equal to 4 years. Choose the option
"Equal to: Value of" for the target cell and enter number 4.
In the window "By changing value of" enter the range of cells,
which contain the numbers of bonds (E2 to E4).
14. Now enter the constraints:
Click on "Add" -- the Constraint window will open.Enter the
address of the cell with the value of the portfolio (B7) in the
"Cell reference."Enter =.Enter 1,000,000 below the word
"Constraint" and click on "Add" in the constraint
window.Repeat steps (i) through (iv) to enter your other
constraint (sum of weights equals to 1.
After you have entered all your constraints, close the Constraint
window.
Click on Solve in the main Solver window (the output is shown
in Figure 1 below).
Figure 1: Solver output for Example 1.
Prices
20. Example 2:Portfolio Optimization
An investor wants to put together a portfolio consisting of up to
5 stocks. What is the best combination of stocks to minimize
risk assuming she wants to earn 9% expected return on her
portfolio?
21. The variances are known for each stock, as are the covariances
between any pair of stocks. The returns for all stocks are also
known.
Variance/Covariance Matrix
Stock 1
Stock 2
Stock 3
Stock 4
Stock 5
Stock 1
2.50%
0.10%
1.00%
-0.50%
1.60%
Stock 2
0.10%
1.10%