Question: MAKE SURE THE CODE RUNS ON SPYDER FirstName _ LastName.py . Answer each question in a cell ( use # % % to detine a
MAKE SURE THE CODE RUNS ON SPYDER FirstNameLastName.py Answer each question in a cell use # to detine a cell Use # to add extra notes to your code. Mke sure that all cells can be executed without any errors. All functions that you need are listed in the TeachingNotePython.pdf file but you are allowed to use other functions that do the task.
Download and import stock price data for
Amazon.com, Inc. AMZN NVIDIA Corporation NVDA and American Airlines Group Inc. AAL from the Yahoo Finance Website from Jan to Dec at the daily frequency. Use the Pandas DataReader yFinance libraries and download data directly from Python.
Download the Fama French factors from Kenneth French's website from Jan to Dec at the daily frequency, using the Pandas DataReader library. Run the 'get available datasets, function in Pandas DataReader to get the ticker list from this website and search through it for the symbol for the daily factor model.
In a timeseries dataFrame, find the daily returns for each stock from their adj close price data.
Merge the two dataFrames ie stock returns and factors in ONE timeseries dataFrame. Notice that the date type between the two data vendors might not match and you need to convert them in the same date format see the teaching note for more details
Based on the FamaFrench Factor model, choose the best stock to invest in For this step, you are asked to
estimate the Sharpe ratio for each stock use merged dataset. Find the average or standard deviation of the daily return of each stock in excess of the daily riskfree rates. Then, calculate the Sharpe ratio with annualized values of these estimates. The one with the higher Sharpe ratio might be identified as the best choice. estimate the riskadjusted excess return for each stock. Find the daily return of each stock in excess of the daily riskfree rates. Then, run the regressions of the threefactor CAPM using the excess returns of each stock as the dependent variables and the Market, Size, and Value factors. The one with the higher might be identified as the best choice.
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
