Discount functions
Define a discount function v(t1,t2) is interpreted as the time t1 value of a payment of 1 at time t2.
0 <= t1, t2
0 < v(t1, t2)
def v(t1: float, t2: float) -> float:
- If t1<t2, then values are discounted to t1 and likely v(t1,t2)<1
- If t1>t2, then values are accumulated to t2 and likely v(t1,t2)>1
For discount functions we assume that
v(t1,t2)v(t1,t2)⋅v(t2,t3)>0=v(t1,t3)∀t1,t2,t3∈R≥0
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) avoids arbitrage opportunities.
If we had
v(t1,t2)⋅v(t2,t3)>v(t1,t3)
We can buy a payment of 1 at time t3 for v(t1,t3) at time 0.
We borrow this initial payment and owe v(t1,t3)⋅v(t2,t1) at time t2. To repay this at time t2 we borrow again and repay (v(t1,t3)⋅v(t2,t1))⋅v(t3,t2). So our t1 net cashflow is 0, t2 net cashflow is 0, and our t3 net cashflow is positive. This is an arbitrage opportunity.
1−(v(t1,t3)⋅v(t2,t1))⋅v(t3,t2)=1−v(t1,t2)⋅v(t2,t3)v(t1,t3)>0
A similar argument applies if v(t1,t2)⋅v(t2,t3)<v(t1,t3).
Formulas
- v(t,t)=1
v(t,t)⋅v(t,t)v(t,t)⋅v(t,t)−v(t,t)v(t,t)⋅(v(t,t)−1)v(t,t)=v(t,t)⟹=0⟹=0⟹=0 or v(t,t)=1
We defined v(t,t)>0, so v(t,t)=1.
- v(t1,t2)=v(t2,t1)1
Follows from v(t1,t2)v(t2,t1)=v(t1,t1)=1
- ∏i=1nv(ti,ti+1)=v(t1,tn+1)
Follows from induction.
Discrete and computational aspects
In practice, we may define discount rates over some discrete range ending at the last timestep N 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) 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)
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
e−k(t2−t1)e−k(t3−t2)=e−k(t3−t1)
To take the present value, v(t)=e−kt. Note that for something like an annual interest rate of 5%, k=ln(1.05).
Code challenge
- Return an array
arr
of length n
where v0[i]
= v(0,i) for a constant interest_rate
- Given an array
annual_interest_rate[i]
= v(i,i+1)−1−1, compute an array pv[i]
= v(0,i)
- Implement a function that takes an array
cashflows
and a discount array pv[i]
= v(0,i) and compute the following
i=0∑Ncashflows[i]⋅v(k,i)
- We want to know all values of a discount function v(t1,t2) where
0 <= t1, t2 < N
We know some values of v(t1,t2), we need to compute the rest of them. The known values of v(t1,t2) come in the format (t1, t2, v(t1, t2))
.
- Under what conditions do we violate v(t1,t2)⋅v(t2,t3)=v(t1,t3)
- Under what conditions is it possible to compute all values of v(t1,t2)?
- If possible, construct a data structure in O(N) that provides O(1) lookup of v(t1,t2) for any
t1, t2
pair.