Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMM 486H: Advanced Topics in Investment Management

Assignment 2, Due March 1, 2023

Question 1: Get started with Google Colab

The effort for this question is to get you familiar with Python.  Increasingly Python is becoming a tool of choice for finance.  Many Microsoft Excel / Spreadsheet applications are migrating to Python, including more fundamental analysis like DCF modeling.  Like Excel, Python is like a whiteboard that allows you to build your analysis, model, etc in any way you want.  Unlike traditional computer languages, Python allows you to be less structured in building your code.  Python code with documentation and text comments looks and feels like a regular document.

We are going to leverage Google’s Colab environment for our work. Colab operates like a notebook for project management combining text and code like a regular document.  If you are familiar with Jupyter Notebooks, Colab is actually built from Jupyter open source.  It essentially allows us to create and share Python computation files without having to download or install anything.

Preparation

1. Download the notebook “yahoo_finance_intro.ipynb” from Canvas and save it to your computer

Get started with Google Colab

2. Go to https://colab.research.google.com

3. Click “Sign in” in the top right corner.

4. Log in with your Google Account. If you do not have a Google Account, you can create one by clicking on “Create account” and following the instructions there.

5. You are now logged in to Google Colab.  For those of you less familiar with Python/Colab, try going through the Getting Started module in the Table of contents on the left.

6. Also in the Table of Contents, try the more resources section.  For example, load the Charts:visualize data module - charts.ipynb  or link: https://colab.research.google.com/notebooks/charts.ipynb and run through the examples

7. Using the file menu, upload the yahoo_finance_intro.ipynb from your computer

8. Try executing the notebook following the instructions on top of the notebook

9. Once you are comfortable with the code, try editing the code by changing the start and end date for Apple (AAPL) to last year (start is now January 1, 2022, end is now December 31, 2022).  Save your work.  Hand in for the assignment:

· Annualized Mean Return and Standard Deviation for AAPL in 2022

· Plots of the stock price and stock returns

· Note: These can be cut and pasted into a document to be handed in (Word or PDF).  The run code with the output is also acceptable

· From charts.ipynb, try making the plots more presentable with labels, titles, etc

10. Repeat 9 for the rest of the FAAMG stocks:  Google (GOOG), Meta-Facebook (META), Amazon (AMZN), Microsoft (MSFT).  Hand in the output for these companies as well.

11. Provide a review of the risk and return data and plots by comparing and contrasting the 5 companies. What characteristics of each company might explain the return and risk differences in 2022?

Question 2: Google Colab working with lists

Preparation

· Download the notebook “yahoo_finance_Canadian_stocks.ipynb” from Canvas and save it to your computer. Also download from Canvas the CSV file of TSX 60 companies, “TSX_Listing 2022.csv”.  Ideally, put the CSV file on your own Google Drive to make it easier to run the python code.

Back to Google Colab

· Go to https://colab.research.google.com

· “Sign in” in the top right corner using your Google Account.

· Using the file menu, upload the “yahoo_finance_Canadian_stocks.ipynb” from your computer

· Once you are comfortable with the code, try editing the directory mount section for your own drive.  Change the variables directory and filename as required.  Note, if you use your own Google drive with a “COMM486h” directory AND didn’t change the file name for “TSX_Listing 2022.csv” the code shouldn’t need changing

· try editing the code by changing the start and end date to last year (start is now January 1, 2022, end is now December 31, 2022).

· Run out the code to get daily returns, annualize average return, annualize standard deviation. Question:  Why does the code use 250 to annualize daily returns?

· Add code to produce a scatter plot of risk (annualized standard deviation) and return (annualized average return). The scatter plot forms our Efficient Frontier for Canadian companies based on 2022 data.  Hint: go back to charts.ipynb discussed in question 1 for example code for scatter plots and add it to your program. Hand in the scatter plot for the assignment.  Like question one:  From charts.ipynb, try making the plots more presentable with labels, titles, etc

· Which companies have the highest return and the lowest return?  Which companies have the lowest risk and highest risk.  Comment on the sensibility of using these historical returns for measuring risk and returns for building portfolios for 2023 and future years.

Question 3: Factor Score, Cross-Sectional Regression

a) For the Canadian company Canadian Tire (CTC/A CT Equity), find its peers and valuations in Bloomberg by using EQRV and export the table to Excel. Like we did with the Canadian Banks, build the factor Scores for Earnings Yield and EBITDA Yield (invert the multiples BF P/E and BF EV/EBITDA to get Yields).  It’s not necessary to calculate market cap weighted scores like did for the Canadian Banks.  We used Book Yield for the Banks, why might EBITDA Yield be more relevant for retailers?

Canadian Tire in the peer table is being compared to many US companies.  Why do you think its valuations/Yields are so different from the US companies?

b) Like we did with the Canadian Banks, run a monthly regression of January total returns for the list of companies against the Earnings Yield and EBITDA Yield.  Report the results of the regression:

· R-squared and Adjusted R-squared

· Intercept Coefficient (return) and t-stat

· Earnings Yield Coefficient (return) and t-stat

· EBITDA Yield Coefficient (return) and t-stat

You can get January’s returns from the COMP function in Bloomberg, or if you are comfortable with Python, pull January’s returns from Yahoo Finance by modifying the code and sheet in Question 2.  Comment on the results of the regression

c) Combine the EarningsYield and EBITDA Yield as a composite Value factor with 50% / 50% weights.  Run a new regression with the January returns and the new Value composite.  Report the same results of the regression as in b) above.  Comment on the differences in the two regressions.

Question 4: Crypto Currencies and Mean-Variance portfolio construction.

Given recent market events in the Crypto markets surrounding FTX, examine Crypto Currencies as an asset class.  Specifically

• Use data provided for Bitcoin, S&P 500 and US 7-10 bonds (Asset Mix Data.xlsx) construct efficient frontiers for Bitcoin vs S&P 500, Bitcoin vs US 7-10 Bonds and S&P 500 vs US 7-10 bonds. Do two sets of frontiers for each pair, one using all the monthly data back to July 2010, other using the monthly data just back to January 2018. So, 6 frontiers in total.  Use the provided Mean-Variance Asset Allocation sheet provided to assist your calculations (Mean Variance Asset Allocation US and Japan.xlsx).  Don’t forget to properly annualize your returns, volatility (standard deviations), and calculate the needed correlations.

• What are the weights for Minimum Variance Portfolios in each frontier?

• In the second tab of the Mean-Variance Asset Allocation is an optimization using Solver. Take your two sets of returns, volatilities, correlations for all 3 asset classes (Bitcoin, S&P 500, and US 7-10 Bonds) and add them to the appropriate cells in tab 2.  Instructions on how to run Solver are right of the calculations.  What are the weights for Minimum Variance Portfolios for the two sets of data.

• Also in Tab 2, you are able to run an optimization for a set target return.  Try some low returns (say 4%) and some higher returns 7%, 8%, 9%, 10%.  Report the portfolio weights for the target returns.  Again, use your two sets of returns, volatilities, and correlations from your two time periods (July 2010 to December 2022) and (January 2018 to December 2022).

• Comment on the appropriateness of using historical returns for Bitcoin to estimate the future.  Provide another estimate and justify your answer, include references.

Note: It’s not necessary for this question, but you could try loading the data in python and reproducing the efficient frontiers and portfolio weights in Python/Colab.  There are several examples in Github for efficient frontiers and portfolio optimizations.