21. Differential Equations in Finance#
An ordinary differential equation (ODE) relates a function \(y = f(x)\) to its derivatives with respect to \(x\). An ODE of order \(n\) is an equation of the form:
Solving differential equations is a vast and important topic in mathematics. In this chapter I will focus on some specific applications that appear in financial problems.
21.1. Continuous Compounding#
We start by deriving the expression for continuous compounding by solving an ODE. Consider an account that starts with an initial balance of \(V_{0}\) and denote by \(V_{t}\) the balance of the account at time \(t.\) The account earns an interest rate \(r\) per unit of time over a time interval \(\Delta t,\) which implies that the balance at time \(t + \Delta t\) is
or
As \(\Delta \rightarrow 0,\) the previous equation becomes:
Equation \(\eqref{ode_bank_account}\) is a linear ODE of first-order and is usually written as
In order to solve it, we need to impose a boundary condition, which in this case is the initial balance of the account at time 0. Define \(X = \ln(V),\) so that \(V = e^{X}\) and \(dV = e^{X} dX.\) Using these results we can re-write \(\eqref{ode_bank_account}\) as:
Integrating \(\eqref{log_ode_bank_account}\) from 0 to \(t\) we obtain:
which can be re-written as:
We already derived equation \(\eqref{ode_bank_account_sol}\) in chapter Interest Rates by different means, but it is nevertheless informative interesting to understand the derivation that we just did. It basically shows that in continuous-time the instantaneous rate of return of a risk-free investment is given by
Also, it is interesting to note that we solved the ODE by defining a new variable \(X = \ln(V).\) This is the so-called change of variable technique that we will use repeatedly to solve other differential equations.
21.2. Valuing an Annuity Paying Continuous Cash Flows#
We will now revisit the valuation of an annuity that pays a continuous flow of cash flows introduced in Example 20.13. Deriving the ODE of the annuity involves again analyzing what happens over a small time interval \(\Delta t.\)
Let us consider an annuity paying coupons \(c \, dt\) at each time \(t \in [0, T].\) Say you do not buy the annuity at time \(t = 0,\) but wait until a later time \(t < T\) to purchase it for \(V_{t}.\) If you hold your investment for a time interval \(\Delta t,\) you can resell it at that point for \(V_{t + \Delta t}.\) In the meantime, you will also receive \(c \Delta t\) since you bought the annuity at time \(t.\) In all these problems we always assume that you buy the security before it goes ex-dividend. The figure below represents the cash flows of this transaction.
Now, as always in finance, we will compare these cash flows with a reference security. Since our annuity is certain, we will use a risk-free investment as our benchmark. Specifically, in this case we will assume that we can use our annuity purchased at time \(t\) and pledge it as collateral. That allow us to borrow money at the risk-free rate of interest. Borrowing \(V_{t}\) at time \(t\) requires then to repay the amount borrowed plus interest, that is \(V_{t} + r V_{t} \Delta t,\) at time \(t + \Delta t.\)
The table below shows the combined cash flows of these transactions.
Time |
\(t\) |
\(t + \Delta t\) |
---|---|---|
Buy Annuity |
\(- V_{t}\) |
\(V_{t + \Delta t} + c \Delta t\) |
Borrow |
\(V_{t}\) |
\(-(V_{t} + r V_{t} \Delta t)\) |
Total |
0 |
\(\Delta V_{t} + c \Delta t - r V_{t} \Delta t\) |
The final strategy requires no investment at time \(t\) but generates a cash flow \(C_{t + \Delta t} = \Delta V_{t} + c \Delta t - r V_{t} \Delta t\) at time \(t + \Delta t.\)
If \(C_{t + \Delta t} > 0,\) we could amplify this transaction by buying as many annuities as possible and borrowing accordingly. That would generate an arbitrary profit at time \(t + \Delta t\) with no investment. If on the other hand \(C_{t + \Delta t} < 0,\) we just need to reverse the transaction, that is, sell as many annuities as possible and invest the proceedings at the risk-free rate.
Either way we could make an arbitrary positive profit with no investment! This is what in finance we call an arbitrage opportunity. Simple intuition tells us that these type opportunities should not last long. Therefore, in the absence of arbitrage opportunities, it must be the case that:
As \(\Delta \rightarrow 0,\) the previous equation becomes:
Define \(X = V e^{-r t}\) so that \(V = X e^{r t}\) and \(dV = (dX) e^{r t} + X \left( r e^{-r t} \, dt \right).\) Using these results we can re-write \(\eqref{ode_1}\) as:
or
We can now integrate \(\eqref{ode_2}\) from \(t\) to \(T\) to get:
We are now in position to solve the problem by applying a boundary condition. Specifically, at time \(T\) the annuity has no more cash flows left top pay, and hence its value must be zero, that is \(V_{T} = 0,\) which also implies that \(X_{T} = 0.\) Plugging \(X_{t} = V_{t} e^{-r t}\) back into \(\eqref{ode_2}\) allows us to find:
21.3. Valuing a Bond Paying Continuous Coupons#
It turns out that the previous analysis applies without modifications to price a bond expiring at time \(T\), with face value \(F\) and paying coupons continuously. What changes is the boundary condition since the bond at time \(T\) pays its face value. So we have that
where \(X(T) = F e^{-r T}.\) Therefore,