Discount-Factor Indexing for Discrete Short-Rate Bond Pricing
Summary
The post concerns indexing a discrete approximation to zero-coupon bond prices when rates are sampled on a time grid. The reply emphasizes distinguishing the money-market accumulation factor from the discount factor: the latter is the reciprocal and uses a negative exponent when built from short rates. With equally spaced dates, the exponent accumulates each period’s annualized rate multiplied by its time increment. The initial rate at time zero is treated as zero in the example, so the first nonzero grid rate contributes to the first interval’s discounting.
The answer illustrates how the accumulated sum grows as successive grid points are included and advises checking whether an index denotes the maturity being priced or the iteration step. This helps locate off-by-one mistakes and clarify notation across sources. The exchange does not fully reconcile every index in the original algorithm, and its displayed formulas appear to use endpoint conventions that may differ from other discretizations. Implementations should align the summation range with the model’s time-step definition and rate sampling convention.
Key ideas
- A zero-coupon discount factor is the reciprocal of a money-market accumulation factor.
- Discrete discounting accumulates short rates multiplied by their corresponding time increments.
- The summation range depends on whether rates represent interval starts, ends, or grid points.
- Careful index definitions help prevent off-by-one errors in bond-price calculations.
- The example uses a zero initial rate, a convention that may differ in other implementations.
Tags
Full text
# HJM simulation problem
# HJM simulation problem
I'm trying to simulate a 3-factor HJM model. I got the algorithms from Glasserman book. In my case, I have $3$ maturity:$ 0.25y, 0.5y, 0.75y$. So my time grid is: $t_0=0,t_1=0.25,t_2=0.5,t_3=0.75$.
I'm trying to price the zero-coupon bonds with:
$B(0,t_j)=\exp(-\sum_{i=0}^{j-1}r(t_i)h_i),\quad \text{where}\quad h_i=t_i-t_{i-1}$
formula. $h_i=\frac{3}{12} \forall i$
$D(t_j)=B(0,t_j)$ and the starting value of $D$ is $1$, as its written in the algorithm.
In the first "for" cycle the index is going only untill $M-1$, which is $2$, so it wont be multipled with $r(t_2)$.
In other words:
$i=1$ $\rightarrow$ $D=D*\exp(-r(t_0)\frac{3}{12} )$,
$i=2$ $\rightarrow$ $D=D*\exp(-r(t_1)\frac{3}{12} ). $
After that the algorithm stops, so I either have to change the max indext to $M$ or just multiple with $\exp(-r(t_2))$ in the end, but i dont think these are the good solutions. Or if in the $i=1$ case, my first update on bondprice would be $r(t_1)$, that would be good too, but then I dont know where $\exp(-r(0))$ is in the algorithm.
## Answer by Jacob M. Morley (score 2, accepted)
https://quant.stackexchange.com/a/10952
I am not sure about this specific algorithmic implementation, but I am a bit confused by your indexes and suspect you might be as well (e.g. $M$ not defined, you're showing cases of $i$ looping when it seems you mean $j$). I think it would be useful to revisit the basics:
Let $D_t \in (0,1]$ be the present value factor for a cash flow at time $t$. By construction, $D_0 = 1$.
Often, $B(0,t_j) = \text{exp}\{\int_0^{t_j} r(t) \ dt\}$ denotes a money market account as a numeraire. The discrete equivalent, as in your implementation, is $B(0,t_j) = \text{exp}\{\sum_{i=0}^{j} r(t_i) \Delta t_i\}$.
If you are building your rates from data from zeroes, you would take the reciprocal $B(0,t_j)^{-1}$, and equate this with the price for the zero with maturity $t_j$ (adjusting for quoting by multiplying by 100). It looks like this is what your $B(0,t_j)$ denotes, from the $-1$ in the exponential. This makes sense (since Bond begins with a "b"), but it could be initially confusing if you are reading papers with the other notation. Anyway, I will use your notation hereafter.
Anyway, in your implementation: Since your $\Delta t$ is constant, $$ B(0,t_j) = \text{exp}\left(-\Delta t \sum_{i=0}^{j} r(t_i)\right) \\ $$ where $r(0) = 0$ and $r$ is the annualized rate.
For clarity, the first iteration, $j=1$, yields: $$ B(0,t_1) = \text{exp}\{-0.25(0+r(t_1))\} \\ $$ and the second iteration, $j=2$, yields: $$ B(0,t_1) = \text{exp}\{-0.25(0+r(t_1)+r(t_2))\} \\ $$ Iterating this for all of your $t$ values should give you what you are looking for.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.