The Question
I'm currently implementing the a finite difference method for the Hull-White model, shown below:
$$\mathrm{d}r(t)=\lambda[\theta(t) − r(t)]\mathrm{d}t + \sigma\mathrm{d}W(t)\tag{1}$$
This requires that I calculate $\theta(t)$ at each point in time, $t$.
I assume I am given a discount curve, an example of which is given below:
Time $t$ in years | Discount Factor |
---|---|
0 | 1 |
0.003 | 0.9998843 |
0.083 | 0.9968031 |
0.167 | 0.9935687 |
... | ... |
0.917 | 0.9629143 |
1 | 0.9599047 |
2 | 0.9200919 |
... | ... |
30 | 0.2699292 |
How do I calculate $\theta$ from such a chart?
My Attempt
On page 73 of Interest Rate Models — Theory and Practice by Brigo and Mercurio, we are given a formula for $\theta(t)$, given below:
$$ \theta(t) = \frac{1}{\lambda} \frac{\partial f^{M}(0, T)}{\partial T}\bigg\rvert_{T = t} + f^{M}(0, t) + \frac{\sigma^2}{2\lambda^2}\Big(1 - e^{-2\lambda t} \Big) \text{,}\tag{2}$$
where $f^{M}(0, t)$ is the market instantaneous forward rate at time $0$ for the maturity $t$. This can be calculated by
$$f^{M}(0, T) = -\frac{\partial P^M(0, T)}{\partial T}\text{,}\tag{3}$$
where $P^M(0, T)$ is the market discount factor for the maturity $T$.
Suppose we wanted to calculate $\theta(t)$. Then we just need to calculate
$$\frac{\partial P^M(0, T)}{\partial T}\tag{4}$$ and $$\frac{\partial^2 P^M(0, T)}{\partial T^2}\tag{5}$$
at $t$ using Taylor series discretizations and plug the formulas into (2).
Choose an $\epsilon$ such as $\epsilon = .000001$. We can try to calculate (5) at $t$ using the three points, $P^M(0, t-\epsilon)$, $P^M(0, t)$, and $P^M(0, t+\epsilon)$.
Well, now our answer boils down to how we estimate $P^M(0, t \pm \epsilon)$, which we estimate using (4) and (5). If we assume that $P$ is piecewise linear, for example, then (5) will always be $0$, except at times $t$ appearing in the chart, where it will blow up.
A different question might be "How do we interpolate $P^M$ for the purpose of calculating $\theta$?"