Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this project, you will learn how to implement Markowitz s portfolio optimization with real - world datasets. You should us the R programming language.
In this project, you will learn how to implement Markowitzs portfolio optimization with realworld datasets.
You should us the R programming language.
a Data Collection
Select stocks listed on the US exchanges. You will construct a portfolio from these stocks.
Tabulate your selection with the corresponding tickers. You may wish to explain the rationale
behind your selection.
Download the price data of the selected stocks and SPY which is the ETF that tracks the S&P
index in the past months. You will compare the performance of your portfolio to the
S&P index and the N strategy. You can download the price data at Yahoo Finance. You
can also use the quantmod package in R
Split the dataset into a training set and a test set. For example, the training set could include
the price data in the first months and the test data covers the last months.
b Estimation
Calculate the daily returns. Hint: If you do not use the adjusted price, then you need to manually
adjust the price for corporate actions.
Estimate the expected return and the covariance matrix Sigma of the selected stocks returns from
the training set.
c Construction of portfolios
We have proved that the optimal portfolio is of the form wopt
gamma
wz wm where wm is the
minrisk portfolio, wz is the zerocovariance portfolio, and gamma is the risk aversion. Calculate the
optimal portfolio for different values of gamma Because we do not know the true values of and Sigma we
have to plug in our estimates and Sigma The resulting portfolio is called the plugin portfolio.
d Insample performance evaluation
You will evaluate the performance of your portfolios on the training set.
Plot the insample efficient frontier in the sigma plane. Highlight the minrisk portfolio in the
graph.
Calculate the mean return and standard deviations of S&P on the training set. Highlight it
in the sigma plane.
Calculate the mean return and standard deviations of the N strategy on the training set.
Highlight it in the sigma plane. Hint: the N strategy invests equally in each asset. If you have
selected stocks, the N strategy invests of wealth in each stock.
Choose a value of gamma Calculate the daily returns of the corresponding optimal portfolios, S&P
and the N strategy on the training set. Compare the insample performance of the portfolios.
Hint: the comparison can be made in terms of mean return, standard deviation, cumulative
return, Sharpe ratio, Treynors ratio, and Jensens alpha, etc. You may need to find the riskfree
rate during the same period. If you need to estimate the beta of your portfolio, you can use S&P
as the market portfolio.
BR Financial and Risk Analytics II Course Project AY S
Comment on your findings.
e Outofsample performance evaluation
You will evaluate the performance of your portfolios on the test set.
Use the same value of gamma as in part d Calculate the daily return of the corresponding optimal
portfolios, S&P and the N strategy on the test set. Compare the outofsample performance
of the portfolios. Hint: the betas in the test set can be different from your previous calculations.
Comment on your findings.
Optional Consider a portfolio that is equally allocated between the optimal portfolio and
the N strategy Comment on its performance. stocks are "AAPL", MSFT "AMZN", JPMVPG "TSLA", JNJ "XOM", "NVDA", SPY
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started