# Examining Yield Curve Similarity (Part 1)
Source: https://www.yieldcurve.pro/blog/examining-yield-curve-similarity-part-1  
Published: 2023-09-05  
Tags: Distance Metrics, Interest Rate environments, Manhattan Distance, Yield Curve

_How to discover similar interest rate environments?_

# Examining Yield Curve Similarity (Part 1)

<br />

### Where Do We Sit Today?

The level of and change in the Yield Curve affects the economy
and return streams across the different asset classes. It's
a reasonable thing to wonder if historical data can be used to
decipher what will transpire in the future.

In order to conduct a study of that sort it would be helpful to
have a metric that says "these past environments are similar to
today's". When we speak of yield curves we typically think of
where it sits in yield space as well as it's shape.

So where does today's yield curve sit and what shape does it
have. The following chart shows the yield curve as of
September 5th 2023.

<img src="/admin/blog/image/62/blog_curve_20230905.png" alt="Treasury yield curve comparison">

The average yield sits somewhere just below 5% and the shape is
"inverted". From the 4-month to the 10-year tenor, rates decrease
monotonically with an odd local maxima (hump) at the 20-year point.
While the level, historically speaking, isn't that unusual the
shape is.

<br />

### Metrics

One way to define similarity is to use a distance metric. One
could use a function of correlation

<!-- prettier-ignore-start -->
$$d(\rho) = \sqrt{2(1 - \rho)}$$
<!-- prettier-ignore-end -->

A naive approach, and the one we'll adopt, is to use the mean average
deviation (or normalized
<a href="https://en.wikipedia.org/wiki/Taxicab_geometry" target="_blank">Manhattan Distance</a>)
between yield curves at two distinct dates

<!-- prettier-ignore-start -->
$$ d(\tau, t) = \frac{1}{N}\sum\_{i=1}^{N}|y_{i}(\tau) - y_{i}(t)|$$
<!-- prettier-ignore-end -->

Notice that this distance is expressed in units of yield. Holding one
date fixed (at say, September 5 2023) and letting the other range over
all available data results in the following chart.

<img src="/admin/blog/image/63/blog_distances_20230905.png" alt="Yield curve distance metrics">

Obviously, the distance between the fixed yield curve and itself will
be zero. So, if we want to identify meaningfully similar yield curves
(i.e., smaller distances) at different points in time we need to begin
looking a certain number of days away from the fixed date. In this
case, we've arbitrarily chosen two quarters on either side. The vertical
dashed line in blue denotes the fixed date and the two orange lines
denote the dates with minimum and maximum distance.

The maximum distance occurs on July 31, 2020 with the corresponding yield
curves shown in the following chart.

<img src="/admin/blog/image/64/blog_different_20230905.png" alt="Most different yield curve shapes">

These curves are on opposite sides of the yield space (level) and have
different shapes (slopes) as the older curve is upward sloping. In
this instance it seems our chosen distance metric works.

The minimum distance occurs on November 14, 2006 with the corresponding yield
curves shown in the following chart.

<img src="/admin/blog/image/65/blog_same_20230905.png" alt="Most similar yield curve shapes">

Again, the distance metric appears to work as intended. Both curves are
centered around the same approximate level of 4.8%. Also, both curves
are inverted with similar slopes.

<br />
### Conclusions

What conclusions can we draw from this? Do the curves with minimum
distance identify similar interest rate environments?

Unfortunately, similar level and slope are not enough. We have completely
ignored path dependency. Namely, what trajectory did each curve travel
to arrive at those configurations? And how would we go about measuring
those? Perhaps we can use the notion of
<a href="/blog/thoughts-on-bear-bull-flatteners-steepeners">Bull, Bear, Flatteners, Steepeners</a>?

We will leave that for a subsequenbt blog post.
