Skip to content
All library documents

Comparing Historical Yield Curve Shapes with Distance Metrics

Article Quant Q&A · Author: PHH

Summary

The document considers how to find historical US yield curves resembling the current curve, using overnight fed funds and on-the-run Treasury yields across several maturities. It proposes measuring differences at each maturity, then selecting the historical date with the smallest distance, while asking whether better shape-matching methods are customary.

The answer says common vector distances such as the sum of absolute differences (L1) or squared differences (L2) are reasonable starting points. If the goal is to compare shape without caring about overall rate level, it describes allowing a parallel shift and minimizing the L1 distance after that shift. It gives the shift as the average difference between corresponding curve points. The choice depends on the purpose: a level-sensitive metric and a shift-adjusted shape metric answer different questions. The discussion does not address maturity weighting, curve interpolation, data quality, or how matching dates would be used in a trading strategy.

Key ideas

  • Represent yields at selected maturities as vectors and compare dates with a distance measure.
  • L1 and L2 distances offer straightforward ways to quantify differences between curves.
  • A parallel-shift adjustment can compare curve shape while ignoring overall rate level.
  • The appropriate metric depends on whether level differences matter to the analysis.
  • The proposed matching method does not establish that a historical analogue predicts future yields.

Tags

Full text
# Overlay Analysis of US Yield Curve


# Overlay Analysis of US Yield Curve












Let's define the US yield curve as the O/N fed funds rate, then the on the run 2/3/5/7/10/20/30y us treasury notes and bonds, represented by their yield to maturity as of today T. What I am trying to do is find a point in time in the past when the yield curve YC(t < T) most "resembles" YC(T). I realize that this is a subjective definition, so I am trying to figure out if there is a usually accepted method? I suppose I could define a measure such as YC_Diff(YC(Ti), YC(Tj)) which measures the YTM deviations (like sum of squares of YTM differences, maybe with weights). Then I could compute the measure for all historical dates available (excluding recent history as this is the most likely match) and return T* such that YC_Diff(YC(T), YC(T*) is the min value across the entire data set? Are there more advanced techniques to match a shape of a curve?

## Answer by Attack68 (score 1)

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

What you suggesting amounts to applying a topology to a space which contains yield curves. The suggested approach which is basically applying the $l_2$ norm seems pretty reasonable, as perhaps would be applying the $l_1$ norm, where the distance between two curves is the sum of the absolute values of their differences.

I would add that depending upon precisely what you are doing you might not care about the overall level of rates but, instead, the shape of the curve, i.e where the term structure is relative to its start. In which case your distance metric, here lets use $l_1$, is amended such that instead of:

$$ D(C_1, C_2) = \sum_{i}^n |C_{1,i} - C_{2,i}| $$

you allow any curve to be shifted in parallel by $\epsilon$ to match the shape of the other:

$$ D(C_1, C_2) = \min_\epsilon \sum_{i}^n |C_{1,i}-C_{2,i}+\epsilon|$$

I will state without proof that $\epsilon$ is probably equal to:

$$\epsilon = \frac{1}{n} \sum_{i=1}^n C_{2,i} - C_{1,i}$$ which makes this quite efficient to calculate rather than solving an optimisation for each date. Taking squares ($l_2$ norm) probably makes this harder, I don't know for sure as I've never investigated.

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.