Bond Pricing in Continuous Time

This notebook studies zero-coupon bond pricing in two canonical short-rate models: Vasicek and Cox-Ingersoll-Ross (CIR). Both models are useful because they deliver closed-form bond prices and yields, making them natural benchmarks for understanding the term structure of interest rates.

Their main difference is how they treat interest-rate volatility. In the Vasicek model, the short rate follows a Gaussian process, which makes the algebra especially transparent but also allows negative rates. That is not necessarily a defect: several countries experienced negative interest rates in the recent past, so allowing for negative realizations can be empirically reasonable. In the CIR model, volatility is proportional to \sqrt{r}, so rate uncertainty falls near zero and the short rate remains nonnegative under standard parameter restrictions. In both cases, the pricing logic is the same: derive the risk-neutral dynamics of the short rate, write the bond-pricing PDE, and exploit the affine structure to solve for bond prices and yields.

The Vasicek Model

The Vasicek (1977) model is one of the foundational equilibrium term-structure models in finance. The single state variable is the short rate r, which follows an Ornstein-Uhlenbeck process: dr = \kappa (\theta - r) \, dt + \sigma \, dB. The stochastic discount factor is then specified as \frac{d\Lambda}{\Lambda} = -r \, dt - (\lambda_0 + \lambda_1 r) \, dB. Let \beta denote the money-market account, so that \frac{d\beta}{\beta} = r \, dt. The parameter \kappa > 0 governs the speed of mean-reversion: the short rate is pulled back toward its long-run mean \theta at rate \kappa. The parameter \sigma controls the instantaneous volatility of the short rate, and \lambda_0 + \lambda_1 r is the market price of interest-rate risk, affine in r. The model is tractable because both the SDF and the short rate are driven by the same Brownian motion B, so interest-rate risk is the only source of uncertainty and bond prices can be derived in closed form.

Vasicek, Oldrich. 1977. “An Equilibrium Characterization of the Term Structure.” Journal of Financial Economics 5 (2): 177–88.
Duffee, Gregory R. 2002. “Term Premia and Interest Rate Forecasts in Affine Models.” The Journal of Finance 57 (1): 405–43.
Dai, Qiang, and Kenneth J. Singleton. 2000. “Specification Analysis of Affine Term Structure Models.” The Journal of Finance 55 (5): 1943–78.

The affine market price of risk, introduced by Duffee (2002), decouples physical and risk-neutral dynamics: \kappa^* and \kappa can differ, so the yield curve can fit risk-neutral parameters while the time series of rates identifies physical ones. This flexibility helps avoid the overidentifying restrictions of completely affine models emphasized by Dai and Singleton (2000).

Consider a zero-coupon bond Z(r, T) with face value $1 maturing in T periods. The fundamental pricing equation in continuous time states that the expected excess return of any asset equals minus the covariance of the SDF with the asset’s return: \operatorname{E}(dZ) - r Z \, dt = -\frac{d\Lambda}{\Lambda} \, dZ. The left-hand side is the expected capital gain in excess of the risk-free return, while the right-hand side captures the risk premium required by investors.

This equation has a direct interpretation in terms of a risk-neutral measure. By Girsanov’s theorem, define the density process \left.\frac{d\operatorname{P}^*}{d\operatorname{P}}\right|_{\mathcal{F}_t} = \frac{\Lambda_t \beta_t}{\Lambda_0 \beta_0}, so that dB^* = dB + (\lambda_0 + \lambda_1 r)\,dt defines a Brownian motion under \operatorname{P}^*. Substituting dB = dB^* - (\lambda_0 + \lambda_1 r)\,dt into the short rate equation, the dynamics of r under \operatorname{P}^* become dr = \kappa^*(\theta^* - r)\,dt + \sigma\,dB^*, \qquad \kappa^* \equiv \kappa + \sigma\lambda_1, \quad \theta^* \equiv \frac{\kappa\theta - \sigma\lambda_0}{\kappa^*}. Under this change of measure, the fundamental pricing equation reduces to \operatorname{E}^*(dZ) = rZ\,dt: every asset earns exactly the risk-free rate in expectation under \operatorname{P}^*, so the discounted price process Z/\beta is a martingale under \operatorname{P}^*.

Solving the PDE

The martingale condition \operatorname{E}^*(dZ) = rZ\,dt translates directly into a PDE for Z(r,T). Applying Ito’s lemma under the risk-neutral dynamics: \begin{aligned} dZ &= Z_r \, dr + \tfrac{1}{2} Z_{rr} (dr)^2 - Z_T \, dt \\ &= \left(\kappa^*(\theta^* - r) Z_r + \tfrac{1}{2} \sigma^2 Z_{rr} - Z_T\right) dt + Z_r \sigma \, dB^*. \end{aligned} The minus sign before Z_T arises because T denotes time to maturity, which decreases as calendar time advances. Setting the drift equal to rZ yields the bond pricing PDE: \kappa^*(\theta^* - r) Z_r + \tfrac{1}{2} \sigma^2 Z_{rr} - Z_T - r Z = 0, \tag{1} subject to the boundary condition Z(r, 0) = 1. The parameters \lambda_0 and \lambda_1 jointly govern the compensation investors demand for interest-rate risk. When \kappa^* > 0, the risk-neutral dynamics remain mean-reverting, and \theta^* generally differs from \theta, embedding a risk premium in bond yields.

To solve (1), we exploit the affine structure of the short rate dynamics and guess a solution of the form Z(r, T) = \exp\left(a(T) + r b(T)\right), so that the log bond price is affine in the short rate. Computing Z_r = b(T) Z, Z_{rr} = b(T)^2 Z, Z_T = (a' + rb')Z and substituting into (1), then collecting terms by powers of r, decouples the equation into two ODEs: \begin{aligned} a' &= \kappa^* \theta^* b + \tfrac{1}{2} \sigma^2 b^2, \\ b' &= -1 - \kappa^* b, \end{aligned} subject to a(0) = 0 and b(0) = 0. Solving explicitly: \begin{aligned} b(T) &= -\phi(T) \, T, \\ a(T) &= -\theta^* T \left(1 - \phi(T)\right) + \frac{\sigma^2}{2(\kappa^*)^2} T\left(1 - 2\phi(T) + \phi(2T)\right), \end{aligned} \tag{2} where \phi(T) = (1 - e^{-\kappa^* T})/(\kappa^* T) satisfies \phi(T) \to 1 as T \to 0 and \phi(T) \to 0 as T \to \infty.

Risk-Neutral Expectation

Under the risk-neutral measure \operatorname{P}^*, the bond price equals the expected discounted payoff: Z(r, T) = \operatorname{E}^*\left[\frac{\beta_0}{\beta_T} \bigg| r_0 = r\right]. Under \operatorname{P}^*, as established above, r follows an OU process with speed of mean reversion \kappa^* and long-run mean \theta^*: dr = \kappa^*(\theta^* - r) \, dt + \sigma \, dB^*. Solving this SDE explicitly gives r_t = \theta^* + (r - \theta^*)e^{-\kappa^* t} + \sigma \int_0^t e^{-\kappa^*(t-s)} \, dB^*_s. Since r_t is an affine function of B^*, the integrated short rate X_T \equiv \int_0^T r_s \, ds is normally distributed under \operatorname{P}^*. Its conditional mean and variance are \begin{aligned} \mu_T &\equiv \operatorname{E}^*[X_T \mid r_0 = r] = \theta^* T\left(1 - \phi(T)\right) + r\phi(T) T, \\ v_T^2 &\equiv \operatorname{V}^*(X_T) = \frac{\sigma^2 T}{(\kappa^*)^2}\left(1 - 2\phi(T) + \phi(2T)\right). \end{aligned} The mean follows directly from integrating \operatorname{E}^*[r_t] = \theta^* + (r - \theta^*)e^{-\kappa^* t}. The variance is obtained by integrating the autocovariance of the OU process, \operatorname{Cov}^*(r_s, r_t) = (\sigma^2/2\kappa^*)(e^{-\kappa^*|t-s|} - e^{-\kappa^*(t+s)}), over the square [0, T]^2.

For any X \sim N(\mu, v^2), the moment generating function gives \operatorname{E}[e^{-X}] = e^{-\mu + v^2/2}, so Z(r, T) = \exp\left(-\mu_T + \tfrac{1}{2}v_T^2\right) = \exp\left(a(T) + r b(T)\right), recovering exactly the affine form with a(T) and b(T) from (2).

The Yield Curve

Writing Z(r, T) = \exp(-y(T) \, T), the continuously-compounded zero-coupon yield is y(T) = \theta^*\left(1 - \phi(T)\right) - \frac{\sigma^2}{2(\kappa^*)^2}\left(1 - 2\phi(T) + \phi(2T)\right) + \phi(T) \, r, an affine function of r, which is the hallmark of affine term-structure models. At the short end, \phi(T) \to 1 so y(T) \to r; at the long end, \phi(T) \to 0 and the yield converges to \lim_{T \to \infty} y(T) = \theta^* - \frac{\sigma^2}{2(\kappa^*)^2}. The asymptotic long yield lies below \theta^* by the convexity correction \sigma^2 / (2(\kappa^*)^2). Because bond prices are a convex function of the short rate, they respond more to rate decreases than to rate increases of the same magnitude. This asymmetry pushes long-term bond prices above what discounting at \theta^* would imply, and correspondingly pulls long yields below \theta^*.

The Cox-Ingersoll-Ross Model

The model proposed by Cox et al. (1985), usually denoted as the CIR model, assumes that the short-term interest rate follows a square-root process, dr = \kappa (\theta - r) dt + \sigma \sqrt{r} dB_{r}.

Cox, John C., Jonathan E. Ingersoll, and Stephen A. Ross. 1985. “A Theory of the Term Structure of Interest Rates.” Econometrica, 385–407.

As with the Vasicek model, the parameter \kappa determines the speed of mean-reversion towards the long-run mean \theta. The main difference with the Vasicek model is that the variance of the short rate depends on its level. As r approaches zero the variance goes down to zero as well. Thus, in the CIR model the short rate cannot be negative.

For the CIR model, the dynamics of the SDF can be specified as \frac{d\Lambda}{\Lambda} = - r dt - \left(\frac{\lambda_{1}}{\sqrt{r}} + \lambda_{2} \sqrt{r} \right) dB_{m}, where (dB_{m})(dB_{r}) = \rho_{rm} dt. The discount factor implies the following risk-neutral dynamics for the short rate, dr = \kappa^* (\theta^* - r) dt + \sigma \sqrt{r} dB_{r}^*, where \kappa^* \equiv \kappa + \sigma \rho_{rm}\lambda_2, \qquad \theta^* \equiv \frac{\kappa\theta - \sigma \rho_{rm}\lambda_1}{\kappa^*}. As in the Vasicek model, zero-coupon bond prices depend on the risk-neutral parameters \kappa^* and \theta^*.

The price P(r, T) of a zero-coupon bond expiring at T satisfies the following PDE \kappa^* (\theta^* - r) P_{r} + \frac{1}{2} \sigma^{2} r P_{rr} - P_{T} - r P = 0, \tag{3} with boundary condition P(r, 0) = 1.

Assume that the bond price can be written as P(r, T) = \exp(A(T) + r B(T)), which implies P_{r} = B P, P_{rr} = B^{2} P and P_{T} = (A' + r B') P. Substituting these expressions in equation (3) we find \kappa^* (\theta^* - r) B + \frac{1}{2} \sigma^{2} r B^{2} - (A' + r B') - r = 0, which implies \begin{aligned} A'(T) & = \kappa^* \theta^* B(T), \\ B'(T) & = \frac{1}{2} \sigma^{2} B^{2}(T) - \kappa^* B(T) - 1, \end{aligned} subject to the boundary conditions A(0) = 0 and B(0) = 0.

To solve for B(T), we can use the following substitution B(T) = - \frac{2}{\sigma^2} \frac{F'(T)}{F(T)}, which implies B'(T) = - \frac{2}{\sigma^2} \frac{F''(T) F(T) - (F'(T))^{2}}{(F(T))^{2}}. Thus, - \frac{2}{\sigma^2} \left[\frac{F''(T)}{F(T)} - \left(\frac{F'(T)}{F(T)}\right)^{2}\right] = \frac{1}{2} \sigma^{2} \frac{4}{\sigma^{4}} \left(\frac{F'(T)}{F(T)}\right)^{2} - \kappa^* \left(- \frac{2}{\sigma^2} \frac{F'(T)}{F(T)}\right) - 1, implying - \frac{F''(T)}{F(T)} = \kappa^* \frac{F'(T)}{F(T)} - \frac{1}{2}\sigma^2, or F''(T) + \kappa^* F'(T) - \frac{1}{2} \sigma^{2} F = 0. \tag{4}

The previous equation is a linear second-order differential equation with a solution of the form F(T) = c_{1} e^{s_{1} T} + c_{2} e^{s_{2} T}. The values of s_{1} and s_{2} are solutions to the second-order characteristic polynomial s^{2} + \kappa^* s - \frac{1}{2} \sigma^{2} = 0. We find that s_1 = \frac{-\kappa^* - \gamma}{2} < 0, \qquad s_2 = \frac{-\kappa^* + \gamma}{2} > 0, \qquad \gamma = \sqrt{(\kappa^*)^{2} + 2 \sigma^{2}}. 1

1 Note that s_{1} s_{2} = -\sigma^{2}/2.

Thus, B(T) = - \frac{2}{\sigma^2} \frac{c_{1} s_{1} e^{s_{1} T} + c_{2} s_{2} e^{s_{2} T}}{c_{1} e^{s_{1} T} + c_{2} e^{s_{2} T}}. The boundary condition B(0) = 0 implies that \frac{c_{1} s_{1} + c_{2} s_{2}}{c_{1} + c_{2}} = 0, or c_{1} s_{1} = - c_{2} s_{2}. Therefore, B(T) = - \frac{2}{\sigma^2} \frac{e^{s_{1} T} - e^{s_{2} T}}{\frac{e^{s_{1} T}}{s_{1}} - \frac{e^{s_{2} T}}{s_{2}}} = - \frac{2\left(e^{\gamma T} - 1\right)}{(\gamma + \kappa^*)\left(e^{\gamma T} - 1\right) + 2\gamma}. \tag{5}

We can now solve for A(T) since \begin{aligned} A(T) & = \kappa^* \theta^* \int_{0}^{T} B(t) dt \\ & = \frac{2\kappa^*\theta^*}{\sigma^2} \ln\left( \frac{2\gamma e^{(\kappa^* + \gamma)T/2}} {(\gamma + \kappa^*)\left(e^{\gamma T} - 1\right) + 2\gamma} \right). \end{aligned} \tag{6}

The CIR Yield Curve

Writing P(r, T) = \exp(-y(T) \, T), the continuously-compounded zero-coupon yield in the CIR model is y(T) = -\frac{A(T)}{T} - \frac{B(T)}{T} r, where A(T) and B(T) are given in (6) and (5). As in the Vasicek model, the yield is affine in the current short rate r, but the loading functions are now nonlinear in the structural parameters because short-rate volatility depends on the level of rates.

At the short end, A(0) = B(0) = 0 and B'(0) = -1, so y(T) \to r as T \to 0. At the long end, B(T) converges to the constant \lim_{T \to \infty} B(T) = -\frac{2}{\gamma + \kappa^*}, while -\frac{A(T)}{T} \to \frac{2\kappa^*\theta^*}{\sigma^2}\left(\frac{\gamma - \kappa^*}{2}\right) = \frac{2\kappa^*\theta^*}{\gamma + \kappa^*}. Therefore, the long-maturity yield is \lim_{T \to \infty} y(T) = \frac{2\kappa^*\theta^*}{\gamma + \kappa^*}. Although \sigma does not appear separately in this expression, it enters through \gamma = \sqrt{(\kappa^*)^2 + 2\sigma^2}, so higher short-rate volatility lowers the asymptotic yield. Unlike the Vasicek model, the long yield in the CIR model is always nonnegative when the risk-neutral parameters are positive.