Discount functions

Define a discount function v(t1,t2)v(t_1, t_2) is interpreted as the time t1t_1 value of a payment of 11 at time t2t_2.

  • 0 <= t1, t2
  • 0 < v(t1, t2)
def v(t1: float, t2: float) -> float:
  • If t1<t2t_1 < t_2, then values are discounted to t1t_1 and likely v(t1,t2)<1v(t_1, t_2) < 1
  • If t1>t2t_1 > t_2, then values are accumulated to t2t_2 and likely v(t1,t2)>1v(t_1, t_2) > 1

For discount functions we assume that

v(t1,t2)>0v(t1,t2)v(t2,t3)=v(t1,t3)t1,t2,t3R0\begin{align} v(t_1, t_2) &> 0 \\ v(t_1, t_2) \cdot v(t_2, t_3) &= v(t_1, t_3) \quad \forall t_1, t_2, t_3 \in \mathbb{R}_{\geq 0} \end{align}

Arbitrage with forward rates

Arbitrage opportunities are when you can create profit with 0 initial investment.

Our definition of a discount function v(t1,t2)v(t2,t3)=v(t1,t3)v(t_1, t_2) \cdot v(t_2, t_3) = v(t_1, t_3) avoids arbitrage opportunities.

If we had

v(t1,t2)v(t2,t3)>v(t1,t3)v(t_1, t_2) \cdot v(t_2, t_3) > v(t_1, t_3)

We can buy a payment of 11 at time t3t_3 for v(t1,t3)v(t_1, t_3) at time 0.

We borrow this initial payment and owe v(t1,t3)v(t2,t1)v(t_1, t_3) \cdot v(t_2, t_1) at time t2t_2. To repay this at time t2t_2 we borrow again and repay (v(t1,t3)v(t2,t1))v(t3,t2)(v(t_1, t_3) \cdot v(t_2, t_1)) \cdot v(t_3, t_2). So our t1t_1 net cashflow is 0, t2t_2 net cashflow is 0, and our t3t_3 net cashflow is positive. This is an arbitrage opportunity.

1(v(t1,t3)v(t2,t1))v(t3,t2)=1v(t1,t3)v(t1,t2)v(t2,t3)>01 - (v(t_1, t_3) \cdot v(t_2, t_1)) \cdot v(t_3, t_2) = \\ 1 - \frac{v(t_1, t_3)}{v(t_1, t_2) \cdot v(t_2, t_3)} > 0 \\

A similar argument applies if v(t1,t2)v(t2,t3)<v(t1,t3)v(t_1, t_2) \cdot v(t_2, t_3) < v(t_1, t_3).


  1. v(t,t)=1v(t, t) = 1
v(t,t)v(t,t)=v(t,t)    v(t,t)v(t,t)v(t,t)=0    v(t,t)(v(t,t)1)=0    v(t,t)=0 or v(t,t)=1\begin{align*} v(t, t) \cdot v(t, t) &= v(t, t) \implies \\ v(t, t) \cdot v(t, t) - v(t, t) &= 0 \implies \\ v(t, t) \cdot (v(t, t) - 1) &= 0 \implies \\ v(t, t) &= 0 \text{ or } v(t, t) = 1 \end{align*}

We defined v(t,t)>0v(t,t) > 0, so v(t,t)=1v(t, t) = 1.

  1. v(t1,t2)=1v(t2,t1)v(t_1, t_2) = \frac{1}{v(t_2, t_1)}

Follows from v(t1,t2)v(t2,t1)=v(t1,t1)=1v(t_1, t_2)v(t_2, t_1) = v(t_1, t_1) = 1

  1. i=1nv(ti,ti+1)=v(t1,tn+1)\prod_{i=1}^n v(t_i, t_{i+1}) = v(t_1, t_{n+1})

Follows from induction.

Discrete and computational aspects

In practice, we may define discount rates over some discrete range ending at the last timestep NN in a simulation.

  • 0 <= t1, t2 <= N
  • 0 < v(t1, t2)
def v(t1: int, t2: int) -> float:

In this case we must consider how to specify the discount rate, and see that the vector

[v(0, t) for t in range(N)]

Allows for O(1)O(1) lookups of the discount rate for any t1, t2 pair

Present value

We can define a 1-parameter version of our discount function

v(t)=v(0,t)v(t) = v(0, t)

This is convenient because we are often interested in the present value, the value at time 0.

Exponential discounting

An exponential function will satisfy our discount function definition

ek(t2t1)ek(t3t2)=ek(t3t1)e^{-k(t_2 - t_1)}e^{-k(t_3 - t_2)} = e^{-k(t_3 - t_1)}

To take the present value, v(t)=ektv(t) = e^{-kt}. Note that for something like an annual interest rate of 5%, k=ln(1.05)k = \ln(1.05).

Code challenge

  1. Return an array arr of length n where v0[i] = v(0,i)v(0, i) for a constant interest_rate
  1. Given an array annual_interest_rate[i] = v(i,i+1)11v(i, i+1)^{-1}-1, compute an array pv[i] = v(0,i)v(0, i)
  1. Implement a function that takes an array cashflows and a discount array pv[i] = v(0,i)v(0, i) and compute the following
i=0Ncashflows[i]v(k,i)\sum_{i=0}^N \text{cashflows}[i] \cdot v(k, i)
  1. We want to know all values of a discount function v(t1,t2)v(t_1, t_2) where

0 <= t1, t2 < N

We know some values of v(t1,t2)v(t_1, t_2), we need to compute the rest of them. The known values of v(t1,t2)v(t_1, t_2) come in the format (t1, t2, v(t1, t2)).

  • Under what conditions do we violate v(t1,t2)v(t2,t3)=v(t1,t3)v(t_1, t_2) \cdot v(t_2, t_3) = v(t_1, t_3)
  • Under what conditions is it possible to compute all values of v(t1,t2)v(t_1, t_2)?
  • If possible, construct a data structure in O(N)O(N) that provides O(1)O(1) lookup of v(t1,t2)v(t_1, t_2) for any t1, t2 pair.