FE5206 Assignment 2, Due: Saturday, 14 October 2023
Submit your answers to Canvas. Word and PDF files are acceptable. Please include your name (family name first) at the beginning of the filename.
In this assignment, you will construct an alpha factor based on the prior 10-day returns and evaluate the effectiveness of the factor.
1. Consider the US market and the years 2006 to 2023 (you will also need some data in 2005 to calculate the alpha factor). The universe used will be based on the universe from the start of the year (defined in univ_h.csv file).
2. To construct the factor,
a) calculate the volatility 𝜎𝑖(𝑡) using the prior 21 days of daily
returns(usethelogreturn 𝑟(𝑡′)=ln( 𝑝𝑖(𝑡′) ),𝑡′ =𝑡−20,…,𝑡,the 𝑖 𝑝𝑖(𝑡′−1)
return is set to 0 if there is an “NA” in the adjusted prices). If 𝜎𝑖 (𝑡)
obtained is less than 0.005, set it to 0.005
b) calculatetheprior10-dayreturn;youcanusethelogreturn
𝑣𝑖(𝑡) = ln( 𝑝𝑖(𝑡) ) (again, the return is set to 0 if the prices are 𝑝𝑖(𝑡−10)
not available)
c) subtract out the 10-day market return 𝑣𝑖(𝑡) → 𝑣𝑖(𝑡) − 𝑣𝑀(𝑡). This
step removes the market component of the alpha factor.
d) normalize the variable by dividing the volatility 𝜎𝑖(𝑡) obtained in
step a), 𝑣𝑖(𝑡) → 𝑣𝑖(𝑡)/𝜎𝑖(𝑡)
3. Do a cross-sectional regression
𝑅𝑖(𝑡 + 1) = 𝛽(𝑡)𝑣𝑖(𝑡) + 𝜖𝑖(𝑡), 𝑖 = 1, … , 𝑁
on everyday t (except for the last day of the available data) and get a
time series of 𝛽(𝑡) and a time series of 𝑅2(𝑡). Here the market
returnisremovedfrom 𝑟(𝑡+1): 𝑅(𝑡+1)=𝑟(𝑡+1)−𝑟 (𝑡+1) 𝑖𝑖𝑖𝑀
For this simple one-variable regression, you can calculate 𝛽(𝑡) and 𝑅2(𝑡) directly:
𝛽(𝑡)=∑ 𝑅 (𝑡+1)𝑣 (𝑡); 𝑅 (𝑡)=1− ∑ 𝜖2(𝑡) 𝑖𝑖𝑖2𝑖𝑖
∑ 𝑣 (𝑡)𝑣 (𝑡) ∑ 𝑅2(𝑡+1) 𝑖𝑖𝑖 𝑖𝑖
4. For the years 2006 to 2023, calculate and list the average of 𝛽(𝑡)
for each year and the corresponding t-stat, √𝑇 ×(the average of
𝛽(𝑡))/(the standard deviation of 𝛽(𝑡)), where T is the number of 𝛽 values obtained for the year. Comment on your results.
5. For the years 2006 to 2023, calculate and list the average 𝑅2(𝑡) for each year. Comment on your results.
Programming Help, Add QQ: 749389476
6. Repeat the calculation (Steps 3-5) using a ranked variable (add a step in the construction of the factor:
2e) rank the normalized variable after step 2d) from the largest (rank 1) to the smallest (rank N) and redefine the factor in terms of the rank, k,
v = (N+1-2k)/(N-1),
N is the number of stocks in the universe on the day
Describe your main computational steps.
Programming Help