Project 2

Stochastic Foundations for Finance

Instructions

This assignment set is due on 12/13 at 11:59 pm CST and is a group assignment. Each group can have a maximum of three students. The assignment must be written in Jupyter using Python. The deliverable is an HTML file of the Jupyter Notebook. The formatting and presentation will count for 40% of the grade, so make sure to format your notebook nicely, explaining in markdown cells your work. Use titles, sub-titles, equations, and properly capitalized sentences to explain what you do. Break your code into chunks and explain what each chunk does.

Methodology

In this project you will estimate the Vasicek (1977) model using zero-coupon rates extracted from Treasury securities. The data for this assignment can be downloaded here. The data was compiled from the Federal Reserve website, and includes the Effective Federal Funds Rate (EFFR) and zero-coupon yields for different maturities ranging from 1 to 30 years. The columns containing the zero-coupon yields are denoted by YXX where XX denotes the maturity. You can consider that all rates are expressed in percents per year with continuous compounding.

Vasicek, Oldrich. 1977. “An Equilibrium Characterization of the Term Structure.” Journal of Financial Economics 5 (2): 177–88.

We saw in class that the Vasicek model under the risk-neutral measure follows an Ornstein-Uhlenbeck process, dr = \kappa (\theta - r) dt + \sigma dz_{r}, where \kappa is the mean-reverting coefficient, \theta is the risk-adjusted long-run short-rate and \sigma is the instantaneous volatility of interest rate changes.

In the model, zero-coupon bond prices can be written as P(r, T) = \exp(A(T) + r B(T)), where \begin{aligned} A(T) & = - \theta^{*} T (1 - \xi(T)) + \frac{1}{2} \frac{\sigma^{2}}{\kappa^{2}} T (1 - 2 \xi(T) + \xi(2 T)), \\ B(T) & = - \xi(T) T, \end{aligned} and \xi(T) = \frac{1 - e^{-\kappa T}}{\kappa T}. Since the price of the zero-coupon bond can also be written as P(r, T) = \exp(- y(T) T), we find that zero-coupon yields for maturity T can be expressed as y(T) = \theta (1 - \xi(T)) - \frac{1}{2} \frac{\sigma^{2}}{\kappa^{2}} (1 - 2 \xi(T) + \xi(2 T)) + \xi(T) r. Furthermore, the instantaneous futures and forward rate for maturity T are \begin{aligned} \varphi(T) & = \theta (1 - e^{-\kappa T}) + e^{-\kappa T} r, \\ f(T) & = \varphi(T) - \frac{1}{2} \frac{\sigma^{2}}{\kappa^{2}} (1 - e^{-\kappa T})^{2}, \end{aligned} respectively.

Questions

  1. Estimate \sigma by computing the standard deviation of the EFFR changes. Report your estimate as a percent.
  2. Estimate \kappa and \theta by minimizing the sum of squares of the difference between the zero-coupon yield predicted by the model and the observed zero-coupon yield. Do this for all observations together, so you will only estimate a single \kappa and \theta using all observations in your sample. For each year, you will use the corresponding EFFR as a proxy for r_{t}. Report the RMSE of your estimation and comment on whether the errors are significant or not.
  3. For each of the years 2000, 2003, 2007, 2013, 2021 and 2023, generate a plot of the term-structure of zero-coupon yields predicted by the model as a function of maturity from 0 to 30 years. For each year, include the observed yields, and comment on how the model captures the observed term-structure of interest rates. In which year(s) the model struggles fitting the term-structure the most?
  4. For the year 2024, generate a plot of the instantaneous futures and forward rates as a function of maturity from 0 to 30 years.
  5. Using the parameters estimated before, and the short-rate as of 11/22/2024, generate a graph of the probability density function of the instantaneous risk-free rate in 1, 5, 20 and 30 years from now.