Spotting the turbulence or How to visualize the yield curve?
The yield curve is a well-known predictor of economic turbulence – if it becomes downward sloped (inverted) – then it is better to wait for a recession.
I wanted to analyze the dynamics of its inversions, however, I faced an interesting challenge – the whole data point is a curve. How does one draw the dynamics of a changing curve? Instead of more serious analysis, this article will be dedicated to experiments of drawing the evolution of the whole yield curve over time, and it belongs to the “fun” section.
All efforts here will be aimed at visualizing the whole curve. It is too easy to visualize just the spread.
Inverted curve or parts of it will be coloured orange, normal parts of the curve will be coloured this colour, sometimes 1-2-3-month yields will be coloured in darker shades because the inversion is of the whole curve is usually determined by the spread between 3-month yield and 10-year yield. In such a case it wouldn’t be accurate to call 1 or 2-month yields inverted.
1. Animation
The most obvious choice is to animate it – put the time on the axis of … time.
As we may see no visual analysis can be done here, we just get an impression – oh, it gets inverted from time to time! Also, rendering such a visualisation takes time which proportion to the computing power of your computer is inverted.
2. Ridgeline
Another quite obvious solution for displaying a lot of lines is a chart type that is basically a lot of lines. Here instead of drawing the whole curve, only the inversion from 3-month yield is displayed. Also, visualizing more than 7000 data points is impractical, so I filtered only the last day of the month.
It looks more like a data art than an informative chart. I would like this one on my wall, but not in a dashboard or ppt.
3. All of them!
But why not drawing all the lines in one chart, with newer ones being distinguished by shades of colour. Here I’m harnessing the power of Tableau with its controls.
Sadly it is quite difficult to understand the evolution of the curve, but it’s a lot of fun to play with it. Also, making those colours to behave exactly as I wanted in Tableau was not that easy and straightforward as I expected!
4. Small multiples
The type of chart that saves the day for many non-Excel users! Here the data is also filtered, only the last day of the month is displayed. Data density is lost, but I’d say now it is possible to see the dynamics with a naked eye.
The month vs year grid is a bit confusing, but with further aggregations I might skip the moments of inversion.
5. 3D surface
Basically we have 3 dimensions to visualize – maturity, yield and time, so a 3-dimensional plot is also a logical solution. Try rotating it!
It is probably the coolest option, and it even gives some insights – inversion happens when short-term yields rise, not when long-term yields drop!
6. Heatmap
Less sophisticated solution to visualize 3 dimensions is a heatmap.
Look how well it captures moments of inversion completely missed in small multiples!
7. Dot plot + viz in tooltip
Every yield is a dot except 3-month yield which is a line. A dot below the black line means this yield is inverted. I consider this chart alone quite easy to understand, but with a full yield curve of a specific day in a tooltip – it becomes epic!
As usual – the simplest and least fancy way proves to be the best!