add test to rate calculation

the test currently doesn't pass, I think there's a bug

Also, add a function to compute the rate graph from a dictionary of rates