FINA5270 Assignment 1

FINA5270__Assignment_1

FINA5270 Assignment 1¶
– This is an individual assignment – please work and submit the workbook individually¶
– Make sure your answers are clearly presented and minimuze unnecessary codes¶

Part 1: Factor Investment/ Smart Beta¶
To properly construct a portfolio, one begins with some specific factors. To keep it simple, we will use the Fama French factors. ¶

Question 1:¶
For both 4-factor and 5-factor Fama French models, download the factor data at monthly frequency from Jan 2018 to March 2023. Please show or answer

a. Show the factors in two dataframes

b. Show the averages of different factors? Which factors have greater impacts?

Question 2:¶
Using the Fama-French 4-Factor model, pick one stock and download the data using yFinance package from Jan 2018 to March 2022. Please show or answer:

a. Using the daily data between Jan 2000 to Dec 2020, please fit an OLS model and show the summary of the result.

b. What’s the expected annualized return based on the Fama-French 4-Factor model?

c. What is the actual return between Jan 2021 until March 2023?

d. Is the return within expectation? If not, what’s the difference? (Please use + Text or Markup to answer)

Part 2: Feature Engineering and Decision Tree¶
Question 1:¶
Download and create three non-stock asset classes such as gold, bond, crypto, REITSs, etc between 2010 to 2022. You may use yFinance and adjusted closing price, if appropriate.

Question 2:¶
Based on the three dataframe, conduct feature engineering and product the following features for EACH dataframe:

Basic Features –

Percentage return with period of 1
Percentage return with period of 5
Percentage return with period of 10
Percentage return with period of 15
Exponential Moving Average with period of 10
Exponential Moving Average with period of 20
Exponential Moving Average with period of 30
Exponential Moving Average with period of 40
Exponential Moving Average with period of 50
Log volume
Difference of log volume day-to-day

Technical Indicator Features –

Create 5 features of your choice

Flag Features –

Create 3 Flag features

One day movement (up: 1, down: 0)

Question 3:¶
Create a heatmap of the correlation matrix
Answer which features are most correlated to the one day movement

Question 4:¶
Use 80% of data as training set and 20% data of test set (Hint: Use appropriate method for financial time series)

Use the features you just created and train Decision Tree models for each dataframe.

What are the out-of-sample accuracies for the three products?

What are the residual mean square errors (RMSE)?

Question 5:¶
Train Random Forest models and provide out-of-sample prediction accuracy for the three products

Part 3: Portfolio Optimization for Conventional and Alternative Assets¶

Question 1: Have a minimal of ten assets. Combine crypto assets and major assets (index, bond, equity) and conduct simulation to find¶
Hint: Refer to the notebook from Lecture 1¶
a) portoflio of minimal volatility and

b) portfolio of the highest Sharpe ratio

Question 2: What is the ideal composition/ weights? Create a correlation matrix and discuss if the selected asseets have high or low correlation with each other.¶

Question 3: We discussed All-Weather Portfolios often. Create a portfolio with 60% of assets in stocks/ crypto/ etc., 40% of assets in bonds. Compare the performance and the Sharpe Ratio with S&P500. You can download the S&P500 ETF as the bench mark.¶

Question 4: Plot your portfolio against the benchmark. How’s the performance? How do you think it can be improved?¶