Interest Rate Curves, Part 3: Global Solver & Jacobian#

See also

Interest Rate Curves, Part 1: Instruments & Bootstrapping solves for one discount factor at a time and Interest Rate Curves, Part 2: Multi-Curve & Basis extends it to several curves. Both assume that each instrument adds exactly one new unknown, that every quote is repriced exactly, and that the curves depend on each other in one direction only. Production curve sets break those assumptions. There are more quotes than unknowns, the quotes contain noise, the curves depend on each other, some quotes involve several maturities at once (the curve spreads of Interest Rate Curves, Part 4: Curve Spreads), and the desk needs the risk to each input. This page covers the tool for these cases, a global solver, and the Jacobian that drives it. The Jacobian does two jobs in a curve build: it is the engine of the solver, and it turns into the risk of every trade to every input quote. Interest Rate Curves, Part 4: Curve Spreads then applies the solver to switches and flies, and Interest Rate Curves, Part 5: Regression Fits covers a different approach, which does not reprice the inputs exactly.

Sequential bootstrap and global solve#

The bootstrap solves for one unknown at a time and never revisits a pillar, which is why it cannot use curve spreads, such as the switches and flies of Interest Rate Curves, Part 4: Curve Spreads. A global solver treats all the discount factors as one vector of unknowns \(x\) and solves for them together. The unknowns are normally the log discount factors, \(x_j = \ln D(T_j)\), which keeps the discount factors positive. For each instrument \(i\), the residual is the difference between the quote that the curve implies and the quote in the market:

\[r_i(x) = \text{par rate}_i(x) - q_i, \qquad i = 1, \dots, m\]

where \(q_i\) is the market quote and \(m\) is the number of instruments. A curve that reprices every input has \(r(x) = 0\). The solver has to find that \(x\). It cannot solve the equations directly, because the par rates are nonlinear functions of the discount factors, so it starts from a guess and improves it. To improve a guess it needs to know how the residuals change when the unknowns change. That is the Jacobian, described in the next section.

Bootstrap compared with a global solve#

Aspect

Sequential bootstrap

Global solve

Unknowns

One at a time, shortest first.

All at once.

Instruments and knots

One instrument per knot, with an exact fit.

Any number of instruments, which can be more than the knots.

Curve spreads (switches and flies)

Cannot be used directly, because one quote involves several maturities.

One more equation in the system, with its own weight.

When quotes disagree

Cannot say. It reprices each in turn, and a bad quote spreads along the curve.

Gives a best fit in the least-squares sense, and the residuals show which quotes are out of line.

Interpolation

Local rules only, such as log-linear or monotone convex.

Any rule, including smooth splines that depend on all the knots.

Curves that depend on each other

Only in one direction, solved in order.

Any dependency, because every curve is in the same system.

Speed

Fast and simple.

Slower, and needs a good starting point, but also gives the Jacobian as a by-product.

Typical use

Prototype, or a liquid curve with one clean instrument per pillar.

Production curve sets, especially with several curves that depend on each other.

When the number of instruments equals the number of knots, the two methods give the same curve. When there are more instruments than knots, the problem is over-determined, and the solver minimises a weighted sum of squares:

\[\min_x \sum_i w_i \, r_i(x)^2 \; + \; \lambda \, R(x)\]

The weights \(w_i\) reflect the bid-offer spread or the reliability of each quote, so a liquid quote counts for more than a wide one. The optional term \(\lambda R(x)\) is a penalty for roughness, such as the integral of the squared change in the forward rate, and it trades fit for smoothness. This is a form of regularisation, and the amount \(\lambda\) is a methodology choice that should be documented.

The Jacobian#

What it is#

The Jacobian is the table of all the first derivatives of the residuals with respect to the unknowns:

\[J_{ij} = \frac{\partial r_i}{\partial x_j}\]

It has one row for each instrument and one column for each unknown. The entry in row \(i\) and column \(j\) answers one question: if the log discount factor at knot \(j\) rises by a small amount, by how much does the par rate of instrument \(i\) change? For a curve with nine swaps and nine knots, \(J\) is a 9 by 9 table of numbers.

A small example#

Take two annual swaps, a 1 year at 4.00% and a 2 year at 3.80%, and two unknowns, \(x_1 = \ln D(1)\) and \(x_2 = \ln D(2)\). The par rate of the 1 year swap is \((1 - D_1)/D_1\), and the par rate of the 2 year swap is \((1 - D_2)/(D_1 + D_2)\), so the residuals are

\[r_1 = \frac{1 - D_1}{D_1} - 0.0400, \qquad r_2 = \frac{1 - D_2}{D_1 + D_2} - 0.0380, \qquad D_k = e^{x_k}\]

and the Jacobian is the 2 by 2 matrix of their derivatives:

\[\begin{split}J = \begin{pmatrix} \partial r_1 / \partial x_1 & \partial r_1 / \partial x_2 \\ \partial r_2 / \partial x_1 & \partial r_2 / \partial x_2 \end{pmatrix}\end{split}\]

The first row is the 1 year swap. It has \(\partial r_1 / \partial x_1 = -1/D_1\) and a zero in the second column, because the 1 year swap does not depend on \(D(2)\) at all. The second row is the 2 year swap, which depends on both discount factors. The sign is negative throughout: raising a discount factor lowers a par rate.

Using it to solve#

Near the current guess, each residual is approximately a straight line in the unknowns, and the Jacobian is the slope:

\[r(x + \Delta x) \approx r(x) + J \, \Delta x\]

The solver sets the right side to zero to find the step that would take the residuals to zero if the lines were exact:

\[J \, \Delta x = -r(x) \;\Rightarrow\; \Delta x = -J^{-1} r(x), \qquad x \leftarrow x + \Delta x\]

This is Newton’s method. In the example, the starting guess is a flat discount rate of 3.5%, which gives \(D_1 = 0.9656\) and \(D_2 = 0.9324\). The residuals are -43.8 and -23.8 basis points, and the Jacobian at that point is

\[\begin{split}J = \begin{pmatrix} -1.0356 & 0 \\ -0.0181 & -0.5087 \end{pmatrix}\end{split}\]

The first number says that a rise of 0.01 in \(\ln D(1)\) lowers the 1 year par rate by 1.04%. Solving \(J \Delta x = -r\) gives a step of \((-0.00423, -0.00453)\), so both log discount factors fall by about 0.4%. After one step the residuals are 0.09 and 0.05 basis points. After two they are zero to four decimal places. Newton’s method converges very fast near the solution, because each step removes most of the remaining error.

The solver repeats the same three actions at each iteration: reprice the instruments to get \(r\), compute \(J\), and solve for \(\Delta x\). The Jacobian is rebuilt each time, since the slopes change as the guess moves. It can be calculated by bumping each unknown and repricing, which is what the example does, or from analytic derivatives, or by automatic differentiation. The cost matters when a curve set has hundreds of unknowns.

When there are more instruments than unknowns, \(J\) is not square and the step solves the least-squares problem instead. With the weights \(W\), and a damping term \(\mu I\):

\[\Delta x = - \left( J^\top W J + \mu I \right)^{-1} J^\top W \, r(x)\]

With \(\mu = 0\) this is Gauss-Newton, and when \(J\) is square and \(W\) is the identity it reduces to the Newton step above. With \(\mu > 0\) it is Levenberg-Marquardt, which adds damping so that the step stays stable when the starting point is poor. The damping is reduced as the iterations converge.

The shape of the Jacobian#

Which entries of \(J\) are not zero shows how the instruments depend on the knots. The example prints the pattern for the nine-swap curve, with a star where the entry is not zero:

Jacobian at the solution, '*' where the entry is not zero:
             1Y   2Y   3Y   5Y   7Y  10Y  15Y  20Y  30Y   <- unknown ln D(T)
  1Y swap    *    .    .    .    .    .    .    .    .
  2Y swap    *    *    .    .    .    .    .    .    .
  3Y swap    *    *    *    .    .    .    .    .    .
  5Y swap    *    *    *    *    .    .    .    .    .
  7Y swap    *    *    *    *    *    .    .    .    .
 10Y swap    *    *    *    *    *    *    .    .    .
 15Y swap    *    *    *    *    *    *    *    .    .
 20Y swap    *    *    *    *    *    *    *    *    .
 30Y swap    *    *    *    *    *    *    *    *    *

A swap depends on the discount factors up to its own maturity and on no later one, so everything above the diagonal is zero. The matrix is lower triangular. That has a useful consequence. A triangular system \(J \Delta x = -r\) can be solved from the top row down: the first equation has one unknown, the second has that one and one more, and so on. That is the bootstrap. The sequential bootstrap is the Newton step for a triangular Jacobian, solved one pillar at a time.

The global solver is needed when the Jacobian is not triangular. That happens when an instrument depends on a knot beyond its own maturity, which is the case for a spline that spreads the effect of each knot over its neighbours, and for curve sets where the curves depend on each other in both directions, as in Interest Rate Curves, Part 2: Multi-Curve & Basis. The entries above the diagonal are then not zero, and the equations have to be solved together.

The Jacobian also says how well-determined the curve is. The condition number of \(J\), which measures how much a small change in the quotes can change the solution, is 45 here, which is a healthy value. A very large number means that some instruments are nearly redundant or that the curve is barely pinned down by the data, and the solution is then unstable.

Worked example: the global fit#

The example runs in five parts. Parts 1 and 2 are the Newton iterations that are described above, first for the two-swap toy and then for the nine-swap curve. Part 3 solves the nine-swap problem with a least-squares solver and compares it with the bootstrap. Part 4 adds two quotes, at 4 and 6 years, that are slightly out of line with the others, and fits eleven quotes with the same nine knots. Part 5 uses the Jacobian for risk, in the next section.

Python code
"""Global solver for the curve, and curve risk from the Jacobian."""
import numpy as np
from scipy.optimize import least_squares

from curve_example import PAR_RATES, PILLARS, Curve, bootstrap, forward_swap

N = 100e6


def curve_from(x, knots=PILLARS):
    """A curve whose unknowns are the log discount factors at the knots."""
    return Curve(np.array(knots, dtype=float), np.exp(x))


def par_rates(curve, maturities):
    return np.array([forward_swap(curve, 0, int(m))[0] for m in maturities])


def solve_global(maturities, quotes, knots=PILLARS):
    """Fit every quote at once. With more quotes than knots this is a least-squares fit."""
    residuals = lambda x: par_rates(curve_from(x, knots), maturities) - quotes
    fit = least_squares(residuals, -0.035 * np.array(knots, dtype=float), method="lm", xtol=1e-14, ftol=1e-14)
    return fit.x, fit.fun


def jacobian(function, x, step=1e-6):
    """Central-difference Jacobian of a vector function."""
    columns = []
    for i in range(len(x)):
        up, down = x.copy(), x.copy()
        up[i] += step
        down[i] -= step
        columns.append((function(up) - function(down)) / (2 * step))
    return np.array(columns).T


def payer_pv(curve, maturity, strike):
    """PV of paying fixed against an overnight floating leg, per unit notional."""
    return (1.0 - curve.df(maturity)) - strike * curve.df(np.arange(1, maturity + 1)).sum()


def newton(maturities, quotes, knots, iterations=6, verbose=False):
    """Newton's method on r(x) = par rates(x) - quotes. Each step solves J dx = -r with the Jacobian J."""
    x = -0.035 * np.array(knots, dtype=float)             # a flat 3.5% guess for the log discount factors
    quote_fn = lambda v: par_rates(curve_from(v, knots), maturities)
    worst = []
    for k in range(iterations + 1):
        r = quote_fn(x) - quotes
        worst.append(np.max(np.abs(r)) * 1e4)
        if verbose and k < 2:
            j = jacobian(quote_fn, x)
            print(f"   iteration {k}: residuals {np.round(r * 1e4, 2)} bp")
            print(f"   Jacobian (rows: instruments, columns: ln D(1Y), ln D(2Y)):\n{np.round(j, 4)}")
            print(f"   step dx = -J^-1 r = {np.round(-np.linalg.solve(j, r), 5)}")
        if k < iterations:
            x = x - np.linalg.solve(jacobian(quote_fn, x), r)
    return x, worst


if __name__ == "__main__":
    quotes = np.array(PAR_RATES)
    base = bootstrap()

    # 1. A toy with two instruments, to show what the Jacobian is and what a Newton step does.
    print("1. Two swaps (1Y at 4.00%, 2Y at 3.80%), two unknowns (ln D(1Y), ln D(2Y)):")
    toy_x, toy_worst = newton([1, 2], np.array([0.0400, 0.0380]), [1, 2], iterations=4, verbose=True)
    print(f"   largest residual by iteration (bp): {np.round(toy_worst, 4)}")
    print(f"   solution: D(1Y) {np.exp(toy_x[0]):.6f}, D(2Y) {np.exp(toy_x[1]):.6f}\n")

    # 2. The nine-swap curve: the shape of the Jacobian, and how fast Newton's method converges.
    quote_fn = lambda v: par_rates(curve_from(v), PILLARS)
    x_newton, worst = newton(PILLARS, quotes, PILLARS)
    j_full = jacobian(quote_fn, x_newton)
    print("2. Nine swaps, nine unknowns. Jacobian at the solution, '*' where the entry is not zero:")
    print("             " + " ".join(f"{p:>3}Y" for p in PILLARS) + "   <- unknown ln D(T)")
    for i, p in enumerate(PILLARS):
        print(f"   {p:>3}Y swap " + " ".join(f"{'*' if abs(j_full[i, k]) > 1e-9 else '.':>4}" for k in range(len(PILLARS))))
    print(f"   largest residual by Newton iteration (bp): {np.array2string(np.array(worst), precision=2, suppress_small=True)}")
    print(f"   largest difference from the bootstrap: {np.max(np.abs(np.exp(x_newton) - base.df(np.array(PILLARS)))):.1e}")
    print(f"   condition number of the Jacobian: {np.linalg.cond(j_full):.1f}\n")

    # 3. The same problem with the least-squares solver, then with more quotes than knots.
    x, residual = solve_global(PILLARS, quotes)
    largest = np.max(np.abs(np.exp(x) - base.df(np.array(PILLARS))))
    print(f"3. Least-squares solver vs bootstrap: largest DF difference {largest:.1e}\n")

    extra_maturities = [4, 6]
    implied = par_rates(base, extra_maturities)
    extra_quotes = implied + np.array([0.00015, -0.00010])
    all_maturities = list(PILLARS) + extra_maturities
    all_quotes = np.concatenate([quotes, extra_quotes])
    x_fit, residual = solve_global(all_maturities, all_quotes)
    order = np.argsort(all_maturities)
    print("4. Eleven quotes, nine knots (4Y and 6Y quoted 1.5bp high and 1.0bp low):")
    for i in order:
        print(f"   {all_maturities[i]:>3}Y  residual {residual[i] * 1e4:+6.2f} bp")

    # 5. Curve risk from the Jacobian, in the three steps, checked against a full rebuild for every quote.
    #    A 6Y swap is not one of the inputs, so its risk falls on the 5Y and 7Y quotes either side.
    j_x = jacobian(quote_fn, x)                       # step 1: d(par rates)/d(log DFs)
    d_x_d_quote = np.linalg.inv(j_x)                  # step 2: d(log DFs)/d(quotes), by the implicit function theorem
    strike = forward_swap(base, 0, 6)[0]
    pv_fn = lambda x_: N * payer_pv(curve_from(x_), 6, strike)
    d_pv_d_x = jacobian(lambda x_: np.array([pv_fn(x_)]), x)[0]   # step 3: d(trade PV)/d(log DFs)
    jacobian_risk = d_pv_d_x @ d_x_d_quote * 1e-4     # per +1bp in each quote

    print(f"\n5. Risk of a 6Y payer swap struck at par (PV {pv_fn(x):,.0f}), in three steps:")
    print("   Step 2: how each log discount factor moves when one quote rises 1bp (bp of ln D)")
    print("   Step 3: how the swap's PV moves when each log discount factor rises 1bp")
    print(f"   {'Pillar':>7} {'5Y quote bump':>14} {'7Y quote bump':>14} {'Swap PV per 1bp of ln D':>25}")
    for k, p in enumerate(PILLARS):
        print(f"   {p:>6}Y {d_x_d_quote[k, 3]:14.3f} {d_x_d_quote[k, 4]:14.3f} {d_pv_d_x[k] * 1e-4:25,.1f}")
    print(f"   Risk to the 5Y quote = sum of (column 1 x column 3) = {np.sum(d_x_d_quote[:, 3] * d_pv_d_x * 1e-4):,.0f}")
    print(f"   Risk to the 7Y quote = sum of (column 2 x column 3) = {np.sum(d_x_d_quote[:, 4] * d_pv_d_x * 1e-4):,.0f}")

    bumped_risk = []
    for i in range(len(PILLARS)):
        bumped = quotes.copy()
        bumped[i] += 1e-4
        bumped_curve = bootstrap(PILLARS, bumped)
        bumped_risk.append(N * payer_pv(bumped_curve, 6, strike) - pv_fn(x))
    print("\n   Risk per +1bp in each input, against bumping the quote and rebuilding the curve:")
    print(f"   {'Input':>6} {'Jacobian':>11} {'Rebuild':>11}")
    for maturity, jac, bump in zip(PILLARS, jacobian_risk, bumped_risk):
        print(f"   {maturity:>5}Y {jac:11,.1f} {bump:11,.1f}")
    print(f"   {'Total':>6} {jacobian_risk.sum():11,.1f} {np.sum(bumped_risk):11,.1f}")

The output for parts 1 to 4 is:

1. Two swaps (1Y at 4.00%, 2Y at 3.80%), two unknowns (ln D(1Y), ln D(2Y)):
   iteration 0: residuals [-43.8 -23.8] bp
   Jacobian (rows: instruments, columns: ln D(1Y), ln D(2Y)):
[[-1.0356  0.    ]
 [-0.0181 -0.5087]]
   step dx = -J^-1 r = [-0.00423 -0.00453]
   iteration 1: residuals [0.09 0.05] bp
   Jacobian (rows: instruments, columns: ln D(1Y), ln D(2Y)):
[[-1.04    0.    ]
 [-0.0193 -0.5098]]
   step dx = -J^-1 r = [1.e-05 1.e-05]
   largest residual by iteration (bp): [43.8029  0.0928  0.      0.      0.    ]
   solution: D(1Y) 0.961538, D(2Y) 0.928190

2. Nine swaps, nine unknowns. Jacobian at the solution, '*' where the entry is not zero:
   (the pattern shown above)
   largest residual by Newton iteration (bp): [43.8   0.17  0.    0.    0.    0.    0.  ]
   largest difference from the bootstrap: 4.5e-13
   condition number of the Jacobian: 45.0

3. Least-squares solver vs bootstrap: largest DF difference 4.5e-13

4. Eleven quotes, nine knots (4Y and 6Y quoted 1.5bp high and 1.0bp low):
     1Y  residual  -0.00 bp
     2Y  residual  -0.00 bp
     3Y  residual  +0.42 bp
     4Y  residual  -1.12 bp
     5Y  residual  +0.35 bp
     6Y  residual  +0.85 bp
     7Y  residual  -0.50 bp
    10Y  residual  +0.00 bp
    15Y  residual  +0.00 bp
    20Y  residual  +0.00 bp
    30Y  residual  +0.00 bp

Reading the output:

  • The toy converges in two steps. The largest residual falls from 43.8 basis points to 0.09 after one Newton step, and is zero to the precision shown after two. The solution is \(D(1) = 0.961538\) and \(D(2) = 0.928190\), which are the discount factors of the swap-only curve from Interest Rate Curves, Part 1: Instruments & Bootstrapping.

  • The nine-swap curve converges just as fast, from 43.8 basis points to 0.17 after one step and below 0.01 after the next. The answer matches the bootstrap to \(10^{-12}\), as it should, since it is the same problem.

  • With extra quotes the curve no longer reprices everything. The misfit of the two extra quotes is shared with their neighbours, from 3 to 7 years. The residuals tell the curve owner which quotes to examine. A fit that leaves a residual is not an error. The question for control is whether the residuals are within the quote’s bid-offer spread.

Using it for risk#

Once the curve is solved, the same Jacobian gives the risk of a trade to every input quote. A trader wants to know how the value of a trade changes when each input quote moves, for example by one basis point. That is a bucketed, or key-rate, risk, and it is also what a hedge is built from, because each input is an instrument that can be traded. There are three steps.

Step 1: the Jacobian at the solution. \(J\) is the matrix that the solver already has.

Step 2: how the curve moves when a quote moves. The curve is defined implicitly by \(r(x, q) = 0\). If a quote \(q_k\) rises by a small amount, the unknowns must change to keep every residual at zero. The implicit function theorem gives the answer. Because each residual is the repriced rate less its own quote, the derivative of the residual with respect to its quote is the identity, and

\[\frac{\partial x}{\partial q} = J^{-1}\]

Column \(k\) of the inverse is the change in every log discount factor when quote \(k\) rises by one unit, with the other quotes held fixed.

Step 3: how the trade’s value moves when the curve moves. The trade has a value \(V(x)\) that depends on the discount factors. Its derivative \(\partial V / \partial x\) has one number per knot. It can be calculated by bumping each discount factor, or analytically.

Combine them with the chain rule. The risk to quote \(k\) is the sum, over all the knots, of the trade’s sensitivity to a knot times the movement of that knot when the quote changes:

\[\frac{\partial V}{\partial q_k} = \sum_j \frac{\partial V}{\partial x_j} \, \frac{\partial x_j}{\partial q_k}, \qquad \text{or, for all quotes at once,} \qquad \frac{\partial V}{\partial q} = \frac{\partial V}{\partial x} \, J^{-1}\]

One matrix inverse serves every trade. Each trade only needs its own \(\partial V / \partial x\). This is much faster than one curve rebuild per input when there are hundreds of inputs, and it is exact, not a finite difference. Automatic differentiation computes the same quantities faster still in large systems.

For several curves, \(J\) covers the whole set. If the curves depend on each other in both directions, \(J\) is not triangular, and one inverse still gives the risk of every trade to every input in every curve.

Worked example: bucketed risk#

The example values a 6-year payer swap, struck at the 6-year par rate, for 100 million on the swap-only curve. A 6-year swap is not one of the inputs, so its risk falls on the quotes on either side. The first table gives the numbers for steps 2 and 3, for the 5 and 7 year quotes:

5. Risk of a 6Y payer swap struck at par (PV 0), in three steps:
   Step 2: how each log discount factor moves when one quote rises 1bp (bp of ln D)
   Step 3: how the swap's PV moves when each log discount factor rises 1bp
    Pillar  5Y quote bump  7Y quote bump   Swap PV per 1bp of ln D
        1Y         -0.000         -0.000                    -352.6
        2Y         -0.000         -0.000                    -340.4
        3Y         -0.000         -0.000                    -487.7
        5Y         -5.087         -0.000                  -4,642.3
        7Y          0.382         -7.404                  -4,176.9
       10Y          0.391          0.715                       0.0
       15Y          0.408          0.745                       0.0
       20Y          0.398          0.727                       0.0
       30Y          0.361          0.659                       0.0
   Risk to the 5Y quote = sum of (column 1 x column 3) = 22,019
   Risk to the 7Y quote = sum of (column 2 x column 3) = 30,926

Reading the table:

  • Step 2, the first two columns. A 1 basis point rise in the 5 year quote lowers \(\ln D(5)\) by 5.09 basis points and does not move the earlier pillars at all, since the Jacobian is triangular. It raises the later pillars by about 0.4 basis points, because the 7 year and longer quotes are held fixed and the curve has to compensate. This is the sawtooth from Interest Rate Curves, Part 1: Instruments & Bootstrapping seen in the discount factors. A 1 basis point rise in the 7 year quote lowers \(\ln D(7)\) by 7.40 basis points.

  • Step 3, the last column. The 6 year swap is sensitive to the discount factors up to 7 years, and not beyond, since its last payment is at 6 years. It is most sensitive to the 5 and 7 year pillars, whose discount factors the 6 year payment dates are interpolated from.

  • The combination. The risk to the 5 year quote is \((-5.087 \times -4642.3) + (0.382 \times -4176.9) \approx 23{,}616 - 1{,}596 = 22{,}020\), in agreement with the 22,019 in the output. The risk to the 7 year quote is \(-7.404 \times -4176.9 \approx 30{,}926\), since the 5 year pillar does not move when the 7 year quote changes.

The Jacobian risk is then compared with bumping each quote by 1 basis point and rebuilding the curve:

Risk per +1bp in each input, against bumping the quote and rebuilding the curve:
 Input    Jacobian     Rebuild
    1Y         0.2         0.2
    2Y         0.4         0.4
    3Y         1.0         1.0
    5Y    22,019.1    22,019.0
    7Y    30,925.5    30,926.7
   10Y         0.0        -0.0
   15Y         0.0        -0.0
   20Y         0.0        -0.0
   30Y         0.0        -0.0
 Total    52,946.3    52,947.3
Bucketed risk of a 6 year payer swap from the Jacobian and from bumping each input

The Jacobian and the bump-and-rebuild agree on the bucketed risk of the 6 year swap.#

  • The risk sits on the 5-year and 7-year inputs, with 22,019 on the 5-year and 30,926 on the 7-year. A trader would hedge with 5-year and 7-year swaps in those amounts.

  • The Jacobian and the rebuild agree. They differ by about one part in 50,000, because the Jacobian is the exact derivative and the bump is a finite 1 basis point change, which includes a small amount of convexity in the trade’s value.

  • The short pillars have a small risk, because the 5-year discount factor depends on the earlier ones through the bootstrap.

The Jacobian is also used for scenario analysis, for hedging (solve for the amounts of the input instruments that offset the risk), and in XVA, where the sensitivities to the curve inputs of a whole portfolio are needed.

Practical points#

  • Starting point: a global solve needs one. The sequential bootstrap is often used to supply it, and the quality of the start decides how many iterations are needed.

  • Convergence: the solver stops when the residuals and the step are below a tolerance. A tolerance that is too loose leaves a repricing error, and a failure to converge is a sign of a bad quote or a bad set-up.

  • Computing the Jacobian: bumping each unknown is simple, but costs one repricing per unknown at every iteration. Analytic derivatives or automatic differentiation are faster for large curve sets.

  • Weights and penalty: these are methodology choices. They should be set from the bid-offer spreads and documented, since they decide how a conflict between quotes is resolved.

  • Snapshots: all the quotes must come from the same time. A stale quote in a global fit spreads its error into the neighbours.

  • Extrapolation: beyond the last liquid pillar the curve is an assumption, such as a flat last forward rate or a convergence to a long-run forward rate, and it needs its own control.

A valuation control view#

  • Independent rebuild: rebuild the curve with a different solver or tool, and compare the discount factors and the par rates. The third part of the output above is a small version of this test, as it compares a global solve with a bootstrap.

  • Review the residuals: for a global fit, the residual by instrument is reviewed against a tolerance based on the bid-offer. A growing residual on one quote is an input problem to investigate.

  • Reconcile the risk: compare the Jacobian risk of a test trade with the risk from bumping, as in the output above, and with the risk system. A break points to a different interpolation, a different set of inputs, or a bug.

  • Check the Jacobian itself: its pattern should match the curve’s structure, triangular for a bootstrap, block triangular when spreads are used (see Interest Rate Curves, Part 4: Curve Spreads), and with known off-diagonal blocks for linked curves. Its condition number should be stable from day to day, and a jump is a sign of redundant or conflicting inputs.

  • Document the choices: the instruments in each pillar, the weights, the penalty, the interpolation and the extrapolation are all part of the methodology. See Governance: Model Risk, Accountability and Data.

  • One methodology everywhere: a curve built one way for pricing and another way for risk will produce risk that does not match the P&L.

  • Link to reserves and levels: quotes for long maturities and for illiquid basis curves may not be observable, which affects the level and the valuation reserves. See Fair-Value Hierarchy: Levels 1, 2 & 3.

Next, Interest Rate Curves, Part 4: Curve Spreads applies the solver to switches and flies, and Interest Rate Curves, Part 5: Regression Fits covers curves that are fitted to the quotes, and not made to reprice them.