※ Using the R script, answer the following questions.
1. Please use the following instructions.
1) Find 19 stocks you want to research. You can find ticker symbols from Google, Yahoo! Finance, MSN money, and so on (i.e. The ticker symbol of Apple Inc. is “AAPL”).
2) Run the following steps.
i. Use the following libraries:
library(quantmod)
library(tseries)
library(xts)
ii. From Yahoo! Finance, download daily prices of stocks (from Jan. 1, 2012 to Dec. 31, 2019) you selected to research. i.e. Suppose that you want to download daily stock prices of Apple Inc. whose ticker symbol is “AAPL”. Then, run as follows:
getSymbols("AAPL", src="yahoo", from='2012-01-01', to='2019-12-31')
iii. Obtain monthly log stock returns for each stock. For example, if you downloaded daily stock prices of Apple, Inc. and Microsoft Corporation, then you will need to run the following:
AAPL.rtn <- monthlyReturn(AAPL$AAPL.Adjusted, subset=NULL, type='log', leading=TRUE)
MSFT.rtn <- monthlyReturn(MSFT$MSFT.Adjusted, subset=NULL, type='log', leading=TRUE)
iv. Prepare your data containing all monthly log stock returns of 19 stocks, and assign the name 'myportfolio' (Please refer to p. 11 on Ch 6 course material to see how 'myportfolio' should look like.)
3) Using 'myportfolio' containing monthly log stock returns of 19 stocks,
a) Find the weights of mean-variance efficient portfolio (you can set your own target return.). Please highlight your answer.
b) Find (plot) efficient frontier.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.