Skip to content
All library documents

Mapping Bond P&L to Swap Curve Buckets and Credit Factors

Article Quant Q&A · Author: Attack68

Summary

The document presents ways to explain bond P&L in a format resembling swap curve attribution. One method maps each bond’s risk to maturity buckets, such as splitting a bond between adjacent swap tenors, then estimates bucket moves by minimizing the difference between explained and observed bond P&L while constraining the total to match. Regularization can stabilize the fit when the bucket system is poorly determined; an alternative penalizes deviations between bond and swap moves through an asset-swap adjustment.

Key ideas

  • Group bonds by issuer curve before mapping their risks to swap-equivalent maturity buckets.
  • A risk-allocation matrix can distribute each bond’s exposure across nearby swap tenors while preserving its total risk.
  • Estimate bucket moves by fitting bond-level P&L and constraining the aggregate explained P&L to match the observed total.
  • Regularization can address unstable or underdetermined fits, while an asset-swap adjustment can keep inferred bond moves near swap moves.
  • A separate approach models credit-risky bonds using rates, CDS inputs, recovery assumptions, and a bond-CDS basis.
  • P&L attribution can also include generic or bond-specific spreads and financing costs.

Tags

Full text
# Allocating bond PnL in a similar way to swaps


# Allocating bond PnL in a similar way to swaps












In fixed income trading, a portfolio may have a large number of derivatives (swaps) positions which are typically aggregated into bucketed points on a curve and a PnL estimation is usually derived via a first (and/or second) order Taylor expansion multiplying bucketed delta (gamma) risks with market movements on that bucketed instruments.

E.g.

$$ P \approx \mathbf{S} \cdot \Delta \mathbf{r} = S_i \Delta r_i $$

With bonds, all of which can have various maturities and attributes affecting their changes on day the more accurate PnL estimation is usually to take the risk on an individual bond, multiply it by the ytm cod and obtain a PnL directly for that instrument:

E.g.

$$ P \approx \mathbf{B} \cdot \Delta \mathbf{y} = B_i \Delta y_i $$

The swap approach provides a better visual representation of data and is more static. How can I reconcile the bond pnl data against a swap style presentation of data?

## Answer by Attack68 (score 2)

https://quant.stackexchange.com/a/78148

One method I have used is described below (adapted Einstein notation, repeated indices are summed).

First, segregate the list of bonds by Issuer curve, so that the same analysis can be repeatedly performed on bonds that share the most similar characteristics.

Secondly, devise some risk map, $A_{ij}$, that transforms a bond of maturity, $m$, into a series of swap equivalent risks. Then the matrix of swap equivalent risk buckets, $i$, for each bond, $j$, is:

$$ S_{ij} = A_{ij} B_j, \qquad \text{such that} \quad \sum_{i} S_{ij} = B_j$$

One basic example is to use linear interpolation; a bond with a 1.25y maturity is allocated 75% to the 1Y bucket and 25% to the 2Y bucket.

Thirdly, we seek the changes $\Delta r_i$ that when applied to swap equivalent risks returns the total PnL, P, but which also minimises the squared error if these changes are applied to each individual bond.

$$ \min_{\Delta r_i} \; \sum_j (S_{ij}\Delta r_i - P_j)^2 \qquad \text{subject to} \quad \sum_j S_{ij} \Delta r_i = P $$

This problem reduces to a linear algebra system which is solvable via matrix inverse. See derivation.

Derivation:

Write the Lagrangian and its derivatives of the optimisation problem,

$$ L(\Delta r_i, \lambda) = \sum_j (S_{ij}\Delta r_i - P_j)^2 - \lambda \left ( P - \sum_j S_{ij} \Delta r_i \right ) \\ L_{\Delta r_k} = 2 S_{kj} ( S_{ij} \Delta r_i -P_j) + \lambda \sum_j S_{kj} \\ L_{\lambda} = P - \sum_j S_{ij} \Delta r_i \\ $$ Noting that these derivatives satisfy zero at minimum form the block matrix equation:

$$ \begin{bmatrix} 2 \mathbf{SS^T} & : & \mathbf{S \delta} \\\\ ... & : & ... \\\\ \left ( \mathbf{S \delta} \right )^{\mathbf{T}} & : & 0\\\\ \end{bmatrix} \begin{bmatrix} \Delta \mathbf{r} \\\\ ... \\\\ \lambda \\\\ \end{bmatrix} = \begin{bmatrix} 2 \mathbf{SP} \\\\ ... \\\\ P \\\\ \end{bmatrix} $$

Issues:

Depending upon the number of bonds and number of swap buckets this system may be underspecified, overspecified or fully specified. This also depends upon the maturities of the bonds. In general there are likely problems for the matrix inverse, so one solution is to introduce a regularisation term meaning that CoD should favour values closer to zero.

$$ \min_{\Delta r_i} \; \sum_j (S_{ij}\Delta r_i - P_j)^2 + \frac{\gamma}{2} \Delta r_i \Delta r_i$$

This alters the block matrix by adding in a scaled identity to the top left:

$$ 2\mathbf{SS^T} \rightarrow 2\mathbf{SS^T} + \gamma \mathbf{I} $$

When all the bond PnLs are zero this creates a rightmost column of zero and bottom row of zero and a matrix without an inverse. In this case there is no information and it is effectively a degenerate solution. All CoD might as well be set to zero. Setting the bottom element of the block matrix to 1 might also be able to yield this solution without runtime errors. For use in Excel $\gamma$ might be set quite high, e.g. 1e6, to avoid numerical issues and provide a matrix with better conditioning.

#### Alternatively (edit)

To provide a more stable response and potentially more informative PnL explanation, the above has been refactored to consider the total bond market move in any given swap bucket is equal to the swap market move plus an asset swap adjustment. I.e.

$$ \Delta r^{bond}_i = \Delta r^{swap}_i + \Delta r^{asw}_i $$

The regularising objective function is then,

$$ \min_{\Delta r^{asw}} = \sum_i \Delta r^{asw}_i \Delta r^{asw}_i $$

i.e. the bond market moves should be as close to the swap market moves as possible, provided that the total bond PnL is achieved:

$$ \sum_{i} \sum_j S_{ij} \Delta r^{bond}_i = P $$

Following the same derivation as above this yields the simpler matrix:

$$ \begin{bmatrix} 2 \mathbf{I} & : & \mathbf{S \delta} \\\\ ... & : & ... \\\\ \left ( \mathbf{S \delta} \right )^{\mathbf{T}} & : & 0\\\\ \end{bmatrix} \begin{bmatrix} \Delta \mathbf{r}^{asw} \\\\ ... \\\\ \lambda \\\\ \end{bmatrix} = \begin{bmatrix} \mathbf{0} \\\\ ... \\\\ P - \delta^T \mathbf{S^T} \Delta \mathbf{r}^{swap} \\\\ \end{bmatrix} $$

## Answer by Dimitri Vulis (score 1)

https://quant.stackexchange.com/a/78151

I will discuss a bond P&L explanation methodology, based on multiple papers by Tomasz Bielecki and by Duffie and Singleton, that many in the industry use successfully for credit-risky bonds and credit default swaps.

I assume that you're already satisfied with your P&L explanation for interest rate swaps (related answer).

For vanilla single-name credit default swaps, the P&L explanation is clear - you have sensitivities to the CDS quotes, you use Taylor expansion. If you occasionally change the recovery assumptions, then you should include them in the P&L explain as well when you do. If your objective is to reduce the unexplained P&L for the CDS, then you definitely should include the first-order interest rate sensitivities in the Taylor expansion, and if you really want to minimize the UPL, then CDS quote gamma, and the cross-gammas between CDS quotes, interest rates, recovery assumptions, and time. The cross-gamma contributions are likely to be too small to be interesting, but are still useful in minimizing the UPL.

These derivatives are marked to model, making P&L explain straightforward. We'd like to reduce credit-risky bonds, whose prices are observable, to mark-to-model. If a CDS curve is available for this credit (otherwise see below), and solve for the bond-CDS basis - an additional market factor for bonds. The basis tells you how much the curves need to be shifted to explain the observable price, typically no more than a couple of hundreds basis points up or down. If you price the bond's (predictable) projected cash flows using a credit derivative pricing model, passing the interest rates, the CDS quotes and recovery assumptions, and the bond-CDS basis as market data inputs, you will reproduce the observable bond price. (Technical notes: you are reproducing the dirty price of the bond, including the accrued interest and any factor from amortization; also, unlike CDS, a bond's accrued is wiped out in default). You can calculate the sensitivities of the model price to the interest rates, the CDS, and the bond-CDS basis; and run P&L explain as for CDS above, but adding the bond-CDS basis delta, gamma, and cross-gammas to the explanation for bond.

If your CDS curve is not observable, then fit one from observable prices of liquid bonds pari passu with yours. In this case, the bond-CDS basis is likely to be small or zero, but it's not a problem. Practically, you should have a procedure to refuse to use observable CDS quotes from a source like CMA if they don't look realistic.

If the bonds are so investment-grade that looking at their CDS with probabilities of default and recovery assumptions makes no sense, then you can just use some generic basis points spread. E.g. the P&L of some Muni was this much because the interest rates moved, that much because the generic spread for all AA-rated Munis moved, and this much because this bond moved idiosyncratically in a way not explained by the the interest rates and the generic spread.

You can also not use any generic spread, but rather attribute the P&L to every individual bond's Z-spread and to the interest rates.

As an aside, for cash bonds, it is insightful to include in the P&L attribution the cost of financing each individual position, as they can vary a lot for different bonds.

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.