Skip to content

1. Affine Bond Pricing: Vasicek Model

One of the most elegant features of the Vasicek model is that we can derive closed-form solutions for zero-coupon bond prices. This is made possible by the model's affine structure, where bond prices take an exponential-affine form in the short rate. This makes the Vasicek model a cornerstone example for understanding affine term structure models.

Before diving in, make sure you're familiar with the Vasicek model fundamentals, including the SDE solution and distribution properties.


1.1 The Bond Pricing Problem

We're looking for the price at time \(t\) of a zero-coupon bond maturing at time \(T\), denoted \(P(t, T)\). Under the risk-neutral pricing framework, this is given by:

\[ \begin{equation} P(t, T) = \mathbb{E}^{\mathbb{Q}}\left[\exp\left(-\int_t^T r(s)ds\right) \bigg| \mathcal{F}_t\right] \label{eq:bond_price_expectation} \end{equation} \]

where:

  • \(\mathbb{E}^{\mathbb{Q}}\) denotes expectation under the risk-neutral measure
  • \(\mathcal{F}_t\) is the information available at time \(t\)

Vasicek Dynamics

The \(r(s)\) process follows the Vasicek dynamics under the risk-neutral measure:

\[dr(s) = a(b - r(s))ds + \sigma dW(s)\]

Parameters are described in table below.

Parameter Symbol Description
Mean reversion \(a\) Speed of reversion to mean (must be positive)
Long-run mean \(b\) Equilibrium level of short rate
Volatility \(\sigma\) Magnitude of rate fluctuations (must be positive)
Brownian increment \(dW(s)\) Standard Brownian motion increment

Computing this expectation directly is non-trivial because we need to integrate a random process. This is where the affine ansatz comes to the rescue.


1.2 The Affine Ansatz

We conjecture that the bond price has the exponential-affine form:

\[ \begin{equation} P(t, T) = A(t, T)e^{-B(t, T)r(t)} \label{eq:affine_ansatz} \end{equation} \]

where \(A(t, T) > 0\) and \(B(t, T) \geq 0\) are deterministic functions to be determined. This form makes intuitive sense:

  • The bond price decreases exponentially with the current short rate (higher rates → lower bond prices)
  • \(B(t, T)\) measures the sensitivity to rate changes (related to duration)
  • \(A(t, T)\) captures the average effect of future expected rates

Boundary Conditions

The boundary condition at maturity is:

\[ \begin{equation} P(T, T) = 1 \quad \Rightarrow \quad A(T, T) = 1, \quad B(T, T) = 0. \label{eq:boundary_conditions} \end{equation} \]

1.2.1 Deriving the Pricing PDE

Under the risk-neutral measure, the bond price must satisfy the fundamental pricing equation:

\[ \begin{equation} \frac{\partial P}{\partial t} + a(b - r)\frac{\partial P}{\partial r} + \frac{1}{2}\sigma^2\frac{\partial^2 P}{\partial r^2} - rP = 0 \label{eq:pricing_pde} \end{equation} \]
Where is \(\ref{eq:pricing_pde}\) comming from?

The equation that satisfies the fundamental pricing equation above, is derived from Ito's formula, when we make \(P(t,T) = f(t,r)\). Recalling the fundamentals of Ito's formula, we can define the variation of function \(f\) using its derivatives (Taylor series expansion of order 2).

\[df=\frac{\partial f}{\partial t}dt+\frac{\partial f}{\partial r}dr+\frac{1}{2}\frac{\partial^2 f}{\partial r^2}(dr)^2\]

We need to replace then \(r\) with Vasicek model, then grouping terms with \(dt\) and \(dW\) we reorganize abovementioned equation to

\[ df= \frac{\partial f}{\partial t}dt+\frac{\partial f}{\partial r} (a(b - r_t)dt + \sigma dW_t)+\frac{1}{2}\frac{\partial^2 f}{\partial r^2}\style{color: var(--math-highlight-4)}{(a(b - r_t) dt + \sigma dW_t)^2} \]

Additionally, we know that the 2-nd power of Vasicek model, recalling \(dt \cdot dW_t = 0\) and \(dt \cdot dt = 0\) because of quadratic variation, that:

\[ \style{color: var(--math-highlight-4)}{(a(b - r_t)d_t + \sigma dW_t)^2} = [a(b-r_t)dt]^2 + 2a(b-r_t)\sigma dt dW_t + [\sigma dW_t]^2 = \style{color: var(--math-highlight-4)}{\sigma^2 dt} \]
\[ df= \frac{\partial f}{\partial t}dt+\frac{\partial f}{\partial r} (a(b - r_t)dt + \sigma dW_t)+\frac{1}{2}\frac{\partial^2 f}{\partial r^2} \style{color: var(--math-highlight-4)}{\sigma^2 dt} \]

Hence,

\[ df= \left[ \style{color: var(--math-highlight-2)}{\frac{\partial f}{\partial t}+\frac{\partial f}{\partial r} (a(b - r_t))+\frac{1}{2}\frac{\partial^2 f}{\partial r^2} \sigma^2} \right] dt + \frac{\partial f}{\partial r} \sigma dW_t \]

Now, recall that under risk-neutral definitions, the stochastic process lacks of any drift component. As a result, and also recalling that the risk-neutral framework makes indifferent a risky asset from a risk-free asset, we make it equal to \(\style{color: var(--math-highlight-3)}{r_t \cdot P}\), which is the price of the bond multiplied by the interest rate \(r_t\), resulting in

\[ \style{color: var(--math-highlight-2)}{\frac{\partial f}{\partial t}+\frac{\partial f}{\partial r} (a(b - r_t))+\frac{1}{2}\frac{\partial^2 f}{\partial r^2} \sigma^2} - \style{color: var(--math-highlight-3)}{r_t \cdot P} = 0 \]

As last a step, recall that at the beginning of this note we started with making \(P(t,T) = f(t,r)\), so you can get back to derive \(\ref{eq:pricing_pde}\)

Next step requires to remember the goal, the affine ansatz equation for a bond which uses Vasicek interest rate model as its dynamics. Let's compute the required partial derivatives using the ansatz equation \(\ref{eq:affine_ansatz}\):

\[ \begin{equation} \begin{aligned} \frac{\partial P}{\partial t} &= \left(\frac{\partial A}{\partial t} - A r \frac{\partial B}{\partial t}\right) e^{-B r} =\left(\frac{1}{A}\frac{\partial A}{\partial t} - r\frac{\partial B}{\partial t}\right)P \\ \frac{\partial P}{\partial r} &= -B A e^{-B r} = -BP \\ \frac{\partial^2 P}{\partial r^2} &= B^2 A e^{-B r} = B^2P \end{aligned} \label{eq:partial_derivatives} \end{equation} \]

Then we can substitute the derivatives of affine anzats model, in order to start shaping the equations that help us to solve both \(A(t,T)\) and \(B(t,T)\). Plugging \(\ref{eq:partial_derivatives}\) into equation \(\ref{eq:pricing_pde}\):

\[ \begin{equation} \left(\frac{1}{A}\frac{\partial A}{\partial t} - r\frac{\partial B}{\partial t}\right)P - a(b - r)BP + \frac{1}{2}\sigma^2 B^2P - rP = 0 \label{eq:pde_substituted} \end{equation} \]

As all the terms are multiplied by P we can divide by \(P\) and rearrange the terms by powers of \(r\):

\[ \begin{equation} \frac{\partial \ln A}{\partial t} + \frac{1}{2}\sigma^2 B^2 - abB + r\left(aB - \frac{\partial B}{\partial t} - 1\right) = 0 \label{eq:pde_rearranged} \end{equation} \]

For this equation to hold for all values of \(r\), the coefficient of \(r\) must vanish, and the constant term must also be zero. This gives us two ODEs! as the terms \(a\) and \(\sigma\) are considered as given from Vasicek calibration. The constant term refers to coefficient of \(r^0\), meanwhile, linear term refers to the coefficient of \(r^1\).

Term Type Expression Resulting ODE
Constant term \(\frac{1}{A}\frac{\partial A}{\partial t} + \frac{1}{2}\sigma^2 B^2 - abB = 0\) \(\frac{\partial \ln A}{\partial t} - abB + \frac{1}{2}\sigma^2 B^2 = 0\)
Linear term \(aB - \frac{\partial B}{\partial t} - 1 = 0\) \(\frac{\partial B}{\partial t} - aB = -1\)

The constant term ODE determines \(A(t, T)\), while the linear term ODE determines \(B(t, T)\).


1.2.2 Solving for \(B(t, T)\)

The coefficient multiplying the term \(r\) gives us the following, with boundary condition \(B(T, T) = 0\).

\[ \begin{equation} \frac{\partial B}{\partial t} - aB + 1 = 0 \label{eq:B_ode} \end{equation} \]

This is a first-order linear ODE. The general solution is:

\[ \begin{equation} B(t, T) = \frac{1 - e^{-a(T-t)}}{a} \label{eq:B_solution} \end{equation} \]
Where is \(\ref{eq:B_solution}\) comming from?

We know that \(\ref{eq:B_ode}\) is equal to say

\[ \frac{\partial B}{\partial t} - aB = -1 \]

Then solving the ODE requires a trick, that is quite popular even to deduct Vasicek formula. It is to multiply in both sides by \(\style{color: var(--math-highlight-4)}{e^{-at}}\) to make the left hand equation a derivative of multiplication. Let's see it below.

\[ \style{color: var(--math-highlight-4)}{e^{-at}} \frac{\partial B}{\partial t} - \style{color: var(--math-highlight-4)}{e^{-at}} a B = -\style{color: var(--math-highlight-4)}{e^{-at}} \]

Now we can identify that the left hand is the same to the derivative of a multiplication.

\[ \style{color: var(--math-highlight-4)}{e^{-at}} \frac{\partial B}{\partial t} - \style{color: var(--math-highlight-4)}{e^{-at}} a B = \style{color: var(--math-highlight-2)}{\frac{d}{d t}[e^{-at} B]} \]

Therefore,

\[ \style{color: var(--math-highlight-2)}{\frac{d}{dt}[e^{-at} B]} = -\style{color: var(--math-highlight-4)}{e^{-at}} \]

Now, let's see what happens if we integrate in both sides, of course with the respective differentials.

\[ \int_t^T d[e^{-as} B(s,T)] = \int_t^T -e^{-as} ds \]
\[ \left[e^{-as} B(s,T)\right]_t^T = -\int_t^T e^{-as} ds \]
\[ e^{-aT} B(T,T) - e^{-at} B(t,T) = -\int_t^T e^{-as} ds \]

Now recall again the terminal condition \(B(T,T) = 0\), to then reorganize to obtain

\[ - e^{-at} B(t,T) = -\int_t^T e^{-as} ds \]
\[ e^{-at} B(t,T) = \int_t^T e^{-as} ds = \left.\frac{e^{-as}}{-a}\right|_t^T = -\frac{e^{-aT}}{a} + \frac{e^{-at}}{a} \]

Eventually we may find \(B(t,T)\) by dividing in both sides by \(e^{-at}\), resulting in:

\[ B(t,T) = -\frac{e^{-aT}}{ae^{-at}} + \frac{1}{a} = \frac{1 - e^{-a(T-t)}}{a} \]

Interpretation:

  • As \(T - t \to 0\) (approaching maturity), \(B(t, T) \to 0\), meaning that short-dated bonds are insensitive to rates.
  • Higher mean reversion \(a\) leads to lower sensitivity for long maturities.

1.2.3 Solving for \(A(t, T)\)

The constant term gives us the following, with boundary condition \(A(T, T) = 1\).

\[ \begin{equation} \frac{\partial \ln A}{\partial t} - abB(t, T) + \frac{1}{2}\sigma^2 B(t, T)^2 = 0 \label{eq:A_ode} \end{equation} \]

Integrating from \(t\) to \(T\):

\[ \begin{equation} \ln A(t, T) = -\int_t^T \left(abB(u, T) - \frac{1}{2}\sigma^2 B(u, T)^2\right)du \label{eq:ln_A_integral} \end{equation} \]

After computing these integrals (which involves some algebra with the exponential form of \(B\)), we get:

\[ \begin{equation} A(t, T) = \exp\left(-\left(b - \frac{\sigma^2}{2a^2}\right)((T-t)+B(t, T)) + \frac{\sigma^2 B(t, T)^2}{4a}\right) \label{eq:A_solution} \end{equation} \]
Where is \(\ref{eq:A_solution}\) coming from?

We need to integrate \(\ref{eq:A_ode}\) from \(t\) to \(T\). Starting with:

\[ \frac{\partial \ln A}{\partial t} = abB(t, T) - \frac{1}{2}\sigma^2 B(t, T)^2 \]

Integrating both sides from \(t\) to \(T\):

\[ \ln A(T, T) - \ln A(t, T) = \int_t^T \left(abB(u, T) - \frac{1}{2}\sigma^2 B(u, T)^2\right)du \]

Using the boundary condition \(A(T, T) = 1\), so \(\ln A(T, T) = 0\):

\[ \ln A(t, T) = -\int_t^T \left(abB(u, T) - \frac{1}{2}\sigma^2 B(u, T)^2\right)du \]

Now we substitute \(B(u, T) = \frac{1 - e^{-a(T-u)}}{a}\) (from \(\ref{eq:B_solution}\)) and compute each integral separately.


First integral: \(\int_t^T abB(u, T)du\)

\[ \int_t^T ab \cdot \frac{1 - e^{-a(T-u)}}{a}du = b\int_t^T (1 - e^{-a(T-u)})du \]
\[ = b\left[u + \frac{1}{a}e^{-a(T-u)}\right]_t^T = b\left[ T + \frac{1}{a} e^{-a(T-T)} - t - \frac{1}{a}e^{-a(T-t)}\right] \]
\[ = b\left[ (T-t) + \frac{e^{-a(T-T)}-e^{-a(T-t)}}{a}\right] = b\left[ (T-t) + \frac{1-e^{-a(T-t)}}{a}\right] \]
\[ = b(T - t) + bB(t,T) \]

Second integral: \(\int_t^T \frac{1}{2}\sigma^2 B(u, T)^2 du\)

\[ \int_t^T \frac{1}{2}\sigma^2 \left(\frac{1 - e^{-a(T-u)}}{a}\right)^2 du = \frac{\sigma^2}{2a^2}\int_t^T (1 - e^{-a(T-u)})^2 du \]

Expanding \((1 - e^{-a(T-u)})^2 = 1 - 2e^{-a(T-u)} + e^{-2a(T-u)}\):

\[ = \frac{\sigma^2}{2a^2}\int_t^T \left(1 - 2e^{-a(T-u)} + e^{-2a(T-u)}\right)du \]
\[ = \frac{\sigma^2}{2a^2}\left[u + \frac{2}{a}e^{-a(T-u)} - \frac{1}{2a}e^{-2a(T-u)}\right]_t^T \]
\[ = \frac{\sigma^2}{2a^2}\left[\left(T + \frac{2}{a}e^{0} - \frac{1}{2a}e^{0}\right) - \left(t + \frac{2}{a}e^{-a(T-t)} - \frac{1}{2a}e^{-2a(T-t)}\right)\right] \]
\[ = \frac{\sigma^2}{2a^2}\left[(T-t) + \left(\frac{2}{a} - \frac{1}{2a}\right) - \frac{2}{a}e^{-a(T-t)} + \frac{1}{2a}e^{-2a(T-t)}\right] \]
\[ = \frac{\sigma^2}{2a^2}\left[(T-t) + \frac{3}{2a} - \frac{2}{a}e^{-a(T-t)} + \frac{1}{2a}e^{-2a(T-t)}\right] \]

Combining the integrals:

\[ \ln A(t, T) = -\left[b(T - t) + bB(t,T) - \frac{\sigma^2}{2a^2}(T-t) - \frac{3\sigma^2}{4a^3} + \frac{\sigma^2}{a^3}e^{-a(T-t)} - \frac{\sigma^2}{4a^3}e^{-2a(T-t)}\right] \]
\[ \ln A(t, T) = -b(T - t) - bB(t,T) + \frac{\sigma^2}{2a^2}(T-t) + \frac{3\sigma^2}{4a^3} - \frac{\sigma^2}{a^3}e^{-a(T-t)} + \frac{\sigma^2}{4a^3}e^{-2a(T-t)} \]

Now, recall that \(B(t, T) = \frac{1 - e^{-a(T-t)}}{a}\), so:

  • \(e^{-a(T-t)} = 1 - aB(t, T)\)
  • \(e^{-2a(T-t)} = (1 - aB(t, T))^2 = 1 - 2aB(t, T) + a^2B(t, T)^2\)

Substituting these relationships and simplifying the exponential terms:

\[ \begin{aligned} \ln A(t, T) &= -b(T - t) - bB(t,T) + \frac{\sigma^2}{2a^2}(T-t) + \frac{3\sigma^2}{4a^3} \\ &\quad- \frac{\sigma^2}{a^3}(1 - aB(t, T)) \\ &\quad+ \frac{\sigma^2}{4a^3}(1 - 2aB(t, T) + a^2B(t, T)^2) \\ \ln A(t, T) &= -b(T - t) - bB(t,T) + \frac{\sigma^2}{2a^2}(T-t) + \frac{3\sigma^2}{4a^3} \\ &\quad- \frac{\sigma^2}{a^3} + \frac{\sigma^2}{a^3}aB(t, T) \\ &\quad+ \frac{\sigma^2}{4a^3} - \frac{\sigma^2}{2a^3}aB(t, T) + \frac{\sigma^2}{4a^3}a^2B(t, T)^2 \end{aligned} \]

Collecting constant terms (they cancel):

\[ \frac{3\sigma^2}{4a^3} - \frac{\sigma^2}{a^3} + \frac{\sigma^2}{4a^3} = 0 \]

Collecting \((T-t)\) terms:

\[ -b(T-t) + \frac{\sigma^2}{2a^2}(T-t) = -\left(b - \frac{\sigma^2}{2a^2}\right)(T-t) \]

Collecting \(B(t,T)\) terms:

\[ -bB(t,T) + \frac{\sigma^2}{a^2}B(t,T) - \frac{\sigma^2}{2a^2}B(t,T) = -\left(b - \frac{\sigma^2}{2a^2}\right)B(t,T) \]

Combining all three groups of terms:

\[ \ln A(t, T) = -\left(b - \frac{\sigma^2}{2a^2}\right)(T-t) -\left(b - \frac{\sigma^2}{2a^2}\right)B(t,T) + \frac{\sigma^2}{4a}B(t,T)^2 \]

Factoring out the common term from the first two components:

\[ \ln A(t, T) = -\left(b - \frac{\sigma^2}{2a^2}\right)\left[(T-t) + B(t,T)\right] + \frac{\sigma^2}{4a}B(t,T)^2 \]

Therefore, exponentiating both sides:

\[ A(t, T) = \exp\left( -\left(b - \frac{\sigma^2}{2a^2}\right)\left[(T-t) + B(t,T)\right] + \frac{\sigma^2}{4a}B(t,T)^2 \right) \]
Why does \(\ref{eq:A_solution}\) look different from other derivations?

Note that the expression for \(A(t, T)\) presented here shows the raw form derived directly from the differential equation. In popular textbooks, this term is often rewritten in alternative forms that are mathematically equivalent but more compact. The reformulation depends on how one groups and simplifies the exponential terms. Both forms are correct; this derivation emphasizes the intermediate steps for pedagogical clarity.

1.3 Brigo and Mercurio

For instance these authors (e.g., Rebonato, Brigo & Mercurio 1, Chapter 3.2.4) make a clarification on this regard, when stating

\[R(t,T) = \alpha(t,T)+\beta(t,T)r(t)\]

where

\[\alpha(t,T) = -\frac{\ln A(t,T)}{T-t};\quad \beta=\frac{B(t,T)}{T-t}\]

This makes the exponent appears as negative in \(\ref{eq:A_solution}\) instead of positive.

1.4 Riccardo Rebonato

Similarly, Rebonnato 2, in Chapter 16, developes the model with similar differences, due to the affine model is represented to as \(P(t,T)=\exp^{A(t,T)+B(t,T)r}\). Beforementioned affine model makes the \(B\)-factor positive, different from our derivation that beggins from an affine ansatz model \(P(t,T) = A(t,T) \exp^{-B(t,T) r}\).

Interpretation:

  • The term involving \(b\) represents the average level of future rates
  • These adjustments ensure that bond prices correctly account for volatility

1.4.1 Complete Bond Pricing Formula

Putting everything together, the zero-coupon bond price under the Vasicek model is:

\[ \begin{equation} P(t, T) = A(t, T)\exp\left(-B(t, T)r(t)\right) \label{eq:vasicek_bond_complete} \end{equation} \]

where:

\[ \begin{equation} B(t, T) = \frac{1 - e^{-a(T-t)}}{a} \label{eq:B_final} \end{equation} \]
\[ \begin{equation} A(t, T) = \exp\left(-\left(b - \frac{\sigma^2}{2a^2}\right)((T-t)+B(t, T)) + \frac{\sigma^2 B(t, T)^2}{4a}\right) \label{eq:A_final} \end{equation} \]

This is a closed-form solution, thereby no numerical integration or Monte Carlo simulation is needed.


1.5 Yield Curve Implications

The continuously compounded yield \(y(t, T)\) is defined as:

\[ \begin{equation} y(t, T) = -\frac{\ln P(t, T)}{T - t} \label{eq:yield_definition} \end{equation} \]

Substituting our affine bond price formula:

\[ \begin{equation} y(t, T) = -\frac{\ln A(t, T)-B(t, T)r(t)}{T - t} \label{eq:vasicek_yield} \end{equation} \]

Yields exhibit an affine (linear) relationship with the current short rate \(r(t)\), meaning bond yields move proportionally with changes in interest rates. The slope of the term structure is determined by whether \(r(t)\) is above or below the long-run mean, allowing the model to generate a rich variety of yield curve shapes. Specifically, the Vasicek model can produce upward-sloping, downward-sloping, and humped yield curves depending on the current level of rates relative to the equilibrium level. The term \(-\frac{\ln A(t, T)}{T - t}\) captures the average forward rate in the absence of current rate effects, representing the structural component of the yield curve independent of present conditions.


1.6 Instantanous Forward Rates

The instantaneous forward rate \(f(t, T)\) is given by:

\[ \begin{equation} f(t, T) = -\frac{\partial \ln P(t, T)}{\partial T} \label{eq:forward_rate_definition} \end{equation} \]

Computing this derivative:

\[ \begin{equation} f(t, T) = -\frac{\partial \ln A(t, T)}{\partial T} + r(t)\frac{\partial B(t, T)}{\partial T} \label{eq:forward_rate_vasicek} \end{equation} \]

Since \(\frac{\partial B(t, T)}{\partial T} = e^{-a(T-t)}\), forward rates are also affine in \(r(t)\).


  1. Damiano Brigo and Fabio Mercurio. Interest Rate Models – Theory and Practice: With Smile, Inflation and Credit. Springer, 2nd edition, 2006. URL: https://link.springer.com/book/10.1007/978-3-540-34604-3

  2. Riccardo Rebonato. Bond Pricing and Yield Curve. Cambridge University Press, 2018. doi:10.1017/9781316694169