Question: Description: Wrte a program on python that calculates the CAPM Beta for a portfolio of at least 1 0 stocks. For the purposes of this
Description:
Wrte a program on python that calculates the CAPM Beta for a portfolio of at least stocks. For the purposes of this assignment assume the stocks are equally weighted in the portfolio. Requirements Calculate Beta Read in remote stock data for a single stock Get the market factor and risk free rate from Ken French's data library and merge it onto the stock information Calculate the CAPM Beta using the data from the previous steps
A CAPM Function Take the code from the first requirement and cre@te a function that accepts a ticker, a beginning date, and an end date as inputs The function should return the beta for the stock using the time interval specified
Portfolio Beta Cre@te a list of at least ten stocks that you will hold in a hypothetical portfolio Use a loop and the CAPM function you wrote to calculate the beta of each of the stocks in your hypothetical portfolio Calculate the portfolio beta by combining the betas of the individual stocks using equal weights
Custom Weights Repeat the work done in step above, however, allow the user to specify asset specific weights for the portfolio beta calculation, rather than using equal weights.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
