I've been thinking about this for a while now and I wanted to check.
source (and thing you should read to understand my answer)
The letter depends on 4 Roman numeral 4s (attack, defense, speed, special), so the full answer would be a 4-dimensional graph. Drawing and reading 4-dimensional graphs is kind of hard. To kind of see what it would look like, you can look at a 2-dimensional slice and read the next few sentences. Each Roman numeral 4 has 4 digits, and the letter depends only on the middle 2 digits of each Roman numeral 4. This means the letter might change if a Roman numeral 4 changes by 7 or 9, but it never changes if a Roman numeral 4 changes by exactly 8. Each Roman numeral 4 has a different "significance", so changing attack's or defense's (the 2 most significant) middle 2 digits always changes the letter, and changing special (the least significant) is not likely to change the letter.