I’m not sure I fully understand what you’re looking for. Can you present an example of the input and what the resulting odds are?
Are you looking for something like … ?
with:
See also here (check posts 15, 17 for faster versions of CUMULATIVE, with many buckets).