Open Midterm 2#
FINM 36700 - 2025#
UChicago Financial Mathematics#
Mark Hendricks
Scoring#
Problem |
Points |
|---|---|
1 |
30 |
2 |
20 |
2 |
20 |
2 |
30 |
Numbered problems are worth 5pts unless specified otherwise.
Submission#
You should submit a single Jupyter notebook (.ipynb) file containing all of your code and answers to Canvas.
Note: If any other files are required to run your notebook, please include them and only them in a single .zip file.
Data#
All data files are found in at the course web-book.
https://markhendricks.github.io/finm-portfolio/.
The exam uses the data found in commodity_factors.xlsx
sheet
factorssheet
returns
Both tabs contain daily returns for a set of commodity futures from January 2010 to October 2025.
approximate 252 observations per year for purposes of annualization
Factors are
LVL: A level factor of commodity data
HMS: Hard Minus Soft commodities
IMO: Input Minus Output commodities
Returns are
various commodity futures across energy, metals, livestock, and agriculture
import pandas as pd
factors = pd.read_excel('./data/commodity_factors.xlsx', sheet_name='factors', index_col=0, parse_dates=True)
returns = pd.read_excel('./data/commodity_factors.xlsx', sheet_name='returns', index_col=0, parse_dates=True)
factors
| LVL | HMS | IMO | |
|---|---|---|---|
| Date | |||
| 2010-01-05 | 0.001741 | -0.003471 | 0.006597 |
| 2010-01-06 | 0.012889 | 0.016399 | -0.020703 |
| 2010-01-07 | -0.011484 | 0.011919 | -0.001153 |
| 2010-01-08 | 0.000436 | 0.007519 | 0.000570 |
| 2010-01-11 | -0.007377 | 0.006306 | -0.000623 |
| ... | ... | ... | ... |
| 2025-10-27 | -0.001392 | -0.004590 | 0.007534 |
| 2025-10-28 | -0.002979 | -0.012895 | 0.002998 |
| 2025-10-29 | 0.008762 | 0.006220 | 0.006162 |
| 2025-10-30 | 0.019519 | 0.027967 | -0.011074 |
| 2025-10-31 | 0.001617 | -0.005249 | -0.006371 |
3972 rows × 3 columns
returns
| CL | GC | HO | LE | NG | PL | RB | SB | SI | ZC | ZL | ZM | ZS | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Date | |||||||||||||
| 2010-01-05 | 0.003190 | 0.000358 | 0.001643 | 0.011127 | -0.041978 | 0.008897 | 0.009789 | 0.000724 | 0.019553 | 0.000597 | -0.004646 | 0.010759 | 0.002620 |
| 2010-01-06 | 0.017244 | 0.015920 | 0.004148 | -0.004344 | 0.065993 | 0.013980 | 0.005459 | 0.027858 | 0.021484 | 0.007164 | -0.000983 | -0.004696 | -0.001663 |
| 2010-01-07 | -0.006251 | -0.002465 | -0.008896 | -0.000291 | -0.033783 | 0.000515 | -0.000796 | -0.014432 | 0.009360 | -0.010077 | -0.016720 | -0.034287 | -0.031176 |
| 2010-01-08 | 0.001089 | 0.004501 | 0.007648 | -0.001164 | -0.009817 | 0.007469 | 0.009555 | -0.016786 | 0.006818 | 0.013174 | -0.011503 | -0.000652 | -0.004667 |
| 2010-01-11 | -0.002779 | 0.010982 | -0.009181 | -0.009030 | -0.051313 | 0.015148 | -0.005846 | -0.028333 | 0.012190 | -0.001182 | -0.008601 | -0.006845 | -0.011106 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2025-10-27 | -0.003089 | -0.028288 | 0.013732 | -0.021070 | 0.041768 | -0.009725 | -0.001196 | -0.034068 | -0.037518 | 0.012995 | 0.009946 | 0.013941 | 0.024478 |
| 2025-10-28 | -0.018920 | -0.008921 | -0.020073 | -0.005790 | -0.028181 | -0.000887 | 0.002499 | -0.006224 | 0.012091 | 0.007580 | -0.010045 | 0.027834 | 0.010307 |
| 2025-10-29 | 0.005486 | 0.004412 | 0.015541 | 0.017143 | 0.009268 | 0.009068 | 0.025192 | 0.003479 | 0.012647 | 0.004630 | -0.001990 | 0.007178 | 0.001855 |
| 2025-10-30 | 0.001488 | 0.004418 | 0.014726 | 0.016746 | 0.171801 | 0.010683 | 0.015048 | -0.009709 | 0.014815 | -0.008641 | -0.010167 | 0.022352 | 0.010183 |
| 2025-10-31 | 0.006769 | -0.004773 | -0.011707 | 0.005632 | 0.042467 | -0.023938 | -0.005141 | 0.010504 | -0.008962 | 0.002905 | -0.019537 | 0.019011 | 0.007789 |
3972 rows × 13 columns
1. Commodity Returns and Factors#
1.1 Factor Summary Statistics#
For each of the three factors, report only the following summary statistics (rounded to at least 6 decimal places):
Annualized Mean Return
Annualized Volatility
Annualized Sharpe Ratio
1.2 Factor Correlations#
Calculate and report the correlation matrix between the three factors (rounded to at least 6 decimal places).
1.3 Interpretation#
Does the factor construction make sense given the correlations you observe?
1.4 Tangency Portfolio Weights#
Build a tangency portfolio using the three factors as assets.
Report the weights of each factor in the tangency portfolio, rounded to at least 6 decimal places. You may assume that the factors use excess return.
1.5 Interpretation#
What do the tangency portfolio weights suggest about the relative importance of each factor?
1.6.#
Estimate an autoregression of the factor LVL…
Only report \(\rho\) (rounded to at least 6 decimal places).
Does the LVL factor exhibit momentum?
2. Single Factor Model#
2.1 LVL Factor#
We want to test the hypothesis that:
Regress each commodity’s returns against the LVL factor, and report the mean absolute alpha, \(\bar{\alpha}\) and \(r^2\) across all commodities.
Annualize the alpha.
Output exactly the following two numbers rounded to 6 decimal places:
Mean Absolute Annualized Alpha across all commodities
Mean R-squared across all commodities
2.2. Interpretation#
If our hypothesis were true, what would you expect the values of \(\bar{\alpha}\) and \(\bar{r^2}\) to be?
2.3 Cross-Sectional Test#
Let’s test the one-factor LVL model directly. From 2.1, we already have what we need:
The dependent variable, (y): mean excess returns from each of the commodities.
The regressor, (x): the market beta for each commodity from the time-series regressions.
Then we can estimate the following equation:
Report exactly the following 3 numbers (rounded to at least 6 decimal places):
The R-squared of this regression
The intercept estimate, \(\hat{\eta}\)
The regression coefficient \(\lambda_{LVL}\)
2.4.#
Does your time-series or cross-sectional estimate give a higher premium to the LVL factor?
3. Trading the Model#
3.1 Beta Estimation#
For each commodity, report their LVL beta rounded to at least 6 decimal places.
Display a table of these betas, sorted from lowest to highest.
Remember#
We estimated the betas in the time-series regression in 2.1.
Hint#
Use df.sort_values(by=<YOUR_DF>, ascending=True) to sort your results.
3.2 Portfolio Formation#
Regardless of your answer to 3.1, allocate your portfolio as follows:
Go long
GC,LE, andZMGo short
CL,HO, andRB
Go long 1 and short 0.25.
That is, your portfolio should be: $\( r_{port} = 1 \cdot \left( \frac{1}{3} \cdot r_{GC} + \frac{1}{3} \cdot r_{LE} + \frac{1}{3} \cdot r_{ZM} \right) - 0.25 \cdot \left(\frac{1}{3} \cdot r_{CL} + \frac{1}{3} \cdot r_{HO} + \frac{1}{3} \cdot r_{RB}\right) \)$ Report the last 5 daily returns of your betting against beta portfolio, rounded to at least 6 decimal places.
3.3 Performance Evaluation#
For your portfolio, report the following performance statistics (rounded to at least 6 decimal places):
Annualized Return
Annualized Volatility
Annualized Sharpe Ratio
3.4#
For your portfolio, test the hypothesis that its premium can be explained by the LVL factor alone:
Report exactly the following 3 numbers (rounded to at least 6 decimal places):
Annualized Alpha
LVLBetaR-squared for the regression
4. Multi-Factor Model#
We now want to test a multi-factor model using LVL and HMS and IMO as factors:
4.1 Time Series Test#
Estimate the time series test of this pricing model. Regress each commodity’s returns against the three factors, and report the following for each commodity (rounded to at least 6 decimal places):
Annualized Alpha
LVL,HMS, andIMOBetasR-squared
4.2#
Report the annualized Sharpe ratio (rounded to at least 6 decimal places) of the tangency portfolio formed from
the individual commodities.
the three factors
What should be true of the Sharpe ratios if the factor pricing model is accurate?
4.3 Cross-Sectional Test#
Run the cross-sectional test of this multi-factor model:
Report exactly the following numbers (rounded to at least 6 decimal places):
\(\lambda_{0}\)
\(\lambda_{LVL}\)
\(\lambda_{HMS}\)
\(\lambda_{IMO}\)
\(r^2\) of the cross-sectional regression
MAE of the cross-sectional regression
Annualize the MAE.
4.4 Interpretation#
Do the results of the cross-sectional test support the multi-factor model?
4.5 Risk Premia#
Compare the risk premia (\(\lambda\)’s) from the cross-sectional test to the average returns of each factor. Report exactly the following table (rounded to at least 6 decimal places):
Average return of each factor
Risk premia from the cross-sectional test
Annualize the estimates.
4.6 Interpretation#
What do you observe from the comparison of average returns and risk premia?
Theoretically, what could cause the risk premium of a factor to deviate from its average return?