How can I take the cumulative sum of a 2D distribution, starting from the highest value in the distribution?
Background: my 2D distribution is the probability of different combinations of wave heights and wave periods based on measurements made at an ocean site. Assume the distribution shows that the most common wave (highest probability, 1%) has a height of 3 meters and a period of 8 seconds. This combination represents the "peak" of a "mountain" in the distribution, i.e. adjacent combinations of wave height/period occur often but less frequently (say 0.1%), and combinations further "downhill" occur even less frequently (say 0.01%). Non-zero probability is spread out over many bins of wave height and wave period so it still totals to 1.
I want to be able to identify the sea states that occur 10% of the time, i.e. make a contour that encloses the height/period combinations that together add up to a probability of 10%. In other words, I can look at the contour and say "10% of the time, wave heights are between 1 and 4 meters and periods are between 6 and 10 seconds". I believe I have to contour the cumulative sum of the 2D distribution starting at the "peak" and working "downhill". What is confusing is that downhill extends in 2 directions since I am summing over 2 variables, height and period.
Any advice is helpful since I am having trouble wrapping my mind around this.