In both dimensions, the values should increase, but not linearly. For example, a rating BBB must have a higher Cumulative Default Rate than a rating A, and the Cumulative Default Rate over 2 years has to be more than over 1 year. I am looking for a smoothing function that makes the values always increase.

I found that by doing a polynomial regression in the second or third degree I get a fairly good smoothing, and it is fairly near to the original values. However, if I do it in the time dimension and then in the rating dimension, my rating regression breaks the time dimension. In the same way, if I start with the rating dimension and then do the regression on the time dimension, it breaks the rating dimension.

I am looking for something like a two-dimensional polynomial regression, or whichever other model that would fit my needs. I coded my problem in R and tried also with the GAM methods and with Loess, but the results are so far away from the original values that I must discard those results. I would appreciate very much any idea from the community. Thank you.