Final 1
Prof. Alan Moreira
Quantitative Finance with Python
• DON’T FORGET TO WRITE YOUR NAME: you will get zero if you don’t!
• No additional materials beyond a pen are allowed
• If you use a pencil you automatically give up on your regrading rights
• You should read each question carefully.
• You can only use the space designed under the question to answer it.
• No extra papers will be accepted.
• Keep it short and to the point!
• Scam the exam first to make sure to answer well the questions that you know well.
• If you don’t know the answer skip it!
• You don’t get points for knowing how to write. Only for writing the right thing!
• I guess close enough counts too, so write something once you are done with the ones you know.
• There are 9 questions (Total of 130 points)
NAME (Please write your Full name, i.e. the one written in the seating chart) :
I pledge by honor I have not received or given any unauthorized information when completing
this exam.
Signature:
1) Here is the output of a regression that has the monthly time-series of excess returns on the
portfolio BEME1 on the time-series of excess returns on the market portfolio. (25 points)
a) Interpret the R-squared of this regression. What do we learn from the fact that it is high?
Answer: The R-squared tells us 90.2% of the variance of excess returns on BEME1 is driven by excess
returns on the market portfolio. The high R-squared means the model is successful for capturing a lot
of variations in realized returns. Note here the R-square captures the extent to which the time-series
variations of excess returns on BEME1 are explained by the time-series variations of excess returns on
the market portfolio.
b) Interpret the intercept of this regression.
Answer: The intercept tells us the alpha of BEME1 after controlling its sensitivity to the market
portfolio is -0.08% per month. An asset pricing model is successful in explaining the average returns
of portfolios if the alphas (intercepts) obtained from the time-series regression of portfolio returns on
the priced factors are not distinguished from zero statistically.
c) What can you test using the t-statistic associated with the intercept of this regression?
Answer: An asset pricing model is successful in explaining the average return of one portfolio if the
alpha (intercept) obtained from the time-series regression of portfolio returns on the priced factors
are not statistically distinguished from zero in terms of small t-statistics. The t-statistics of -1.43
means BEME1 cannot reject the one-factor model where the factor is the market portfolio.
d) What does the P>|t| associated with the t-statistic tell you in this case? Interpret in light of your
earlier answer.
Answer: P>|t| of 0.15 tells us there is 15% chance that the market portfolio is mean-variance
efficient portfolio if the tested portfolio is BEME1.
e) Interpret the slope of this BEME1 with respect to the market. What does this slope measure?
Answer: The slope of 1.01 tells us if the excess return on the market portfolio increases 1%, on
average the excess return on BEME1 will increase 1.01%. Thus, the slope measures the sensitivity
of excess returns on BEME1 to excess returns on the market portfolio.
f) (bonus) What is the Appraisal ratio on the BEME1 portfolio (You can write the formula and plug
the numbers. No need to actually do the computation) (this should be very simple)
Answer: Appraisal ratio is the alpha of the BEME1 divided by the volatility of the residual from this
time-series regression, Appraisal ratio = αi/σ(ϵi,t).
2) You have a DataFrames in your notebook called Data which contains monthly excess returns on
11 portfolios. After you run this code below you get the output below. (25 points)
a) Write code that allows you to estimate the market risk-premium using the information in
the Estimates dataframe.
Answer: What we have in the Estimates dataframe is the average returns of portfolios
BEME1-BEME12 and the associated betas. To estimate the market risk-premium we need to
run one cross-sectional regression of average returns on betas with intercept as follows
y = Estimates['AvgReturns']
x = sm.add_constant(Estimates['beta'])
results = sm.OLS(y,x).fit()
b) By looking at the numbers provide a very rough estimate what this estimate of the market
risk-premium will be. Explain the logic of your “estimation” (this should be a sentence).
Answer: Because the market risk-premium is essentially the slope of the fitted line between
the average return and betas, it can be roughly estimated by the difference of the average
returns on the two extreme portfolios divided by the difference of their betas.
c) Interpret the R-squared of the regression that you run in (a). What does it mean?
Answer: The R-squared tells us how many the variations in the average excess returns on
portfolios BEME1- BEME10 are explained by the variations in their betas on the market
portfolio. Note here the R-square captures the extent to which the cross-sectional
variations in the average returns on BEME1- BEME10 are explained by the cross-sectional
variations in their betas on the market portfolio.
d) State all the predictions of the CAPM that can be tested in this regression. (Be specific. You
do not need to tell me how to test it).
Answer: Prediction 1: The intercept of the regression should be equal to zero.
Prediction 2: The market risk premium should be equal to the time series average of
excess returns on the market portfolio.
e) Discuss conceputally how the Fama-MacBeth method for testing the CAPM works (explain
how you would implement the Fama-MacBeth procedure. Think of this as the different
steps involved in it and not actual code)
Answer: When implementing the Fama-MacBeth method, instead of running one single
cross-sectional regression of the average excess returns on the betas, 1) we first run cross-
sectional regressions of the excess returns on the betas at each time, e.g., month-by-month,
that is we need to run T cross-sectional regressions to get the time series of the estimated
parameters (intercepts and coefficients on the betas); 2) we take the sample means and
standard errors of these estimated parameters as the estimates we want to get.
f) Write code that implements the Fama-MacBeth procedure.
Answer:
FamaMacbeth = Data.iloc[:,0:2].copy()
FamaMacbeth.columns = ['gamma0','gamma1']
x = sm.add_constant(Estimates['beta'])
for date in Data.index:
y = (Data.loc[date,:]).iloc[0:10]
results = sm.OLS(y,x).fit()
FamaMacbeth.set_value(date,'gamma0',results.params[0])
FamaMacbeth.set_value(date,'gamma1',results.params[1])
coefficientsAVG = FamaMacbeth.mean()
coefficientsSTDEV = FamaMacbeth.std()
samplesize = FamaMacbeth.shape[0]
tstat = coefficientsAVG/(coefficientsSTDEV/(samplesize**0.5))
g) (bonus) Explain why the regression that you run in (a) provides misleading estimates of the
standard errors associated with the estimated parameters.
Answer: The disadvantage of the approach in (a) is that it doesn’t delivers the correct
standard errors by taking into account the cross-sectional correlations of the portfolio
returns.
3) There is a set of 10 portfolios below. (20 points)
a. What information do you need to construct the tangency/mean-variance efficient
portfolio for these portfolios?
Answer: The mean and variance-covariance matrix of excess returns on these portfolios.
b. Provide a formula using the information in (a) for the tangency portfolio weights.
w∗
Answer: w ∗ = var(R)−1 𝐸(𝑅) and the tangency portfolio weights are given by w = ∑ ∗ .
i=1 w𝑖
c. What information do you need for the minimum variance portfolio?
Answer: Only the variance-covariance matrix of excess returns on these portfolios is
needed.
d. Provide a formula for the minimum variance portfolio weights
Answer: w ∗ = var(R)−1 𝐼 where 𝐼 is a 10-by-1 identity matrix. Then the minimum variance
w∗
portfolio weights are given by w 𝑚𝑖𝑛 = ∑ w∗
i=1 𝑖
4) I found a strategy with very large expected returns, in fact average return twice as large as the
market average return. Is this a market anomaly? Explain. (10 points)
Answer: Not really. If this strategy has a market beta of 2 then its large expected return is
exactly what is predicted by the CAPM and thus is not a market anomaly.
5) We run a time-series regression of the excess return of a trading strategy on the excess return
on the market Ret=α+β(Remkt,t)+ϵt. We find that std(ϵt) is very high relative to std(Ret), that is
the regression R-squared is very low. What do we learn about the CAPM? (10 points)
Answer: The low R-squared of the time-series regression tells us the CAPM is not a good model
to capture the time-series variations in the realized excess returns on this trading strategy.
6) We find that a cross-sectional regression of the average stock returns on the betas of stock
return on an excess return factor Ft has an extremely high R-squared, that is Ri=βiλ+ϵi holds,
with std(ϵi) very small relative to std(Ri), so variations in betas explain the bulk of variations in
average returns. What do we learn about the CAPM? (10 points)
Answer: The high R-squared of the cross-sectional regression tells us the CAPM is a good model
to capture the cross-sectional variations in the average excess returns on these stocks by the
cross-sectional variations in the betas.
7) I run a regression of market excess returns on portfolio A excess returns: Rmkt,t =α+β(RA,t)+ϵt. I
found α is small with a t-stat of 0.8. What does that mean? (10 points)
Answer: The small α with a t-stat of 0.8 tells us that investing in the market portfolio cannot
enhance the Sharpe ratio relative to investing in the portfolio A. In other words, the market
portfolio is not able to beat the portfolio A.
8) You can invest in two portfolios: the market portfolio and the momentum portfolio. The market
has (annual) Sharpe Ratio of 1 and Momentum has an (annual) Appraisal ratio relative to the
market of 1 as well. The risk-free rate is 5%. What is the maximum expected return that you can
earn if you want the annual standard deviation of your portfolio to be less than 10%? (you can
just write formulas and plug the numbers. No need to actually do the calculations) (10 points)
Answer: The maximum Sharpe ratio by investing in both the market portfolio and the
momentum portfolio is given by
SharpeRatio2Max = SharpeRatio2MKT + ApprasialRatio2momentum = 2
which implies ExpectedReturnMax = √2 ∗ std + R riskfree = √2 ∗ 0.1 + 0.05.
9) Fama argues that value stocks have high expected returns because they are risky. Richard Thaler
and Robert Shiller argue that value stocks have high expected returns because investors
irrationally dislike them. Tobias Moskowitz (a professor from Yale and Principal at AQR) argues
that no matter what is the right explanation for the fact that value stocks have high expected
returns, the average investor should invest in value stocks since everyone agrees that they have
high expected returns. Do you agree with Toby? Explain. (10 points)
Answer: If Tobias Moskowitz is right and the average investor does want to invest in the value
stocks because of their high expected returns, then this trading will be driving up the prices of
those value stocks and thus the expected returns will be reduced. The average investor will
continue purchasing the value stocks until their expected returns are equal to expected returns
on the growth stocks so there is no incentive for him to invest more. In other words, the value
premium will be eventually arbitraged away. However, this is inconsistent with the empirical
evidence of the persistent and significant value phenomenon in the long term.