# Visualising credit rating stability

I am looking for a way to visualize credit rating stability results.

Some background: Per rating class (e.g. AAA, AA+, AA, AA-, A+, ...), I look at the percentage of obligors that keep their rating from one year to the other. E.g. if in rating class BBB, I have 100 counterparts at t, and, of these 100, only 85 remained in rating class BBB at time t+1, the percentage of obligors that keep their rating from t to t+1 is 85%.

Doing so, I get a table like:

    t to t+1    t+1 to t+2    ...    t+n-1 to t+n
AAA      80%           90%    ...             85%
AA+      75%           92%    ...             85%
...
Caa      60%           55%    ...             67%


To visualize this, I tried line graphs for each of the rating classes, but this way I end up with way too many graphs; it becomes very messy. I thought about grouping the ratings into broader classes but I lose some information this way.

Does anyone know about a good visualization technique for this kind of problem?

• I guess you considered 3D plots. I don’t think 3D plots are a good option, especially for print. ggplot’s facet_grid might be an option. – Bob Jansen Mar 22 '18 at 10:22
• facet_grid could be a possibility too. I have somewhat of a preference over the heat map from @phdstudent though. – koteletje Mar 22 '18 at 13:11

One option to do it is a heatmap. Not sure which software are you using, but in matlab it is extremely simple to do and powerful to tweak.

Below an example. Let's assume there are 30 periods $t$ to $t+30$ and 21 ratings.

Then you could run:

rating = {'Aaa'; 'Aa1';'Aa2';'Aa3';'A1';'A2';'A3';'Baa1';'Baa2';'Baa3';'Ba1';'Ba2';'Ba3';'B1';'B2';'B3';'Caa1';'Caa2';'Caa3';'Ca';'C';}
ratingindex = (1:size(rating,1));
t = [1:30]';
prop = rand(size(rating,1),size(t,1));
[X, Y] = meshgrid(t,ratingindex);
[Xq,Yq,Vq] = griddata(t,ratingindex,prop,X,Y);
surf(Xq, Yq, Vq)
view(2);
xlabel('Time')
ylabel('rating')
colorbar
title('Probability of keeping rating')


The output would be: Where the colors indicate probabilities. The $x-axis$ has the time and the $y-axis$ the ratings. For easiness I have categorized the ratings in 1 to 10 instead of the AAA, AA+, etc. But you can easily change the appearance of the axis.

Following the comment below, you can easily have less colors in the plot. Just add: colormap(lines(n)) for n colors. For n=3 the output would look as follows: Further, persistence in ratings should help with disciplining the output.

• Upvoted, but with the remark that the colors can be hard to interpret. – Bob Jansen Mar 22 '18 at 11:12
• Agreed. I think two things may help: (1) Here I am assigning random probabilities of keeping the rating; In reality they will be very stable so the actual output will not have this mess of colors; (2) It is easy to change the colormap to have less colors (e.g. 3 colors or so). I edited the answer above. – phdstudent Mar 22 '18 at 11:14
• Thanks @phdstudent, a heat map is a good idea indeed. I use R so I can easily create one too with ggplot(<code>) + stat_bin_2d() + <code> – koteletje Mar 22 '18 at 13:08