Question
Get data from Yahoo! Finance for Microsoft, Dow Chemical, and Johnson & Johnson for 2014-2019 and save them to .csv files. Then, create a Python
Get data from Yahoo! Finance for Microsoft, Dow Chemical, and Johnson & Johnson for 2014-2019 and save them to .csv files. Then, create a Python program that finds the portfolio weights on the three stocks that minimize the portfolio volatility given that the expected return on the portfolio has to be at least 9%.
You will need to first calculate the log returns for each stock. Then, second, you will need to calculate the covariances between each pair of stocks. Third, use these covariances to create the covariance matrix in Python. You can use the average return over the time period as the expected return. (This is a silly assumption, but we need to get numbers from somewhere!)
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