How to vectorize indexing of variable for pm.math.sum?

Try computing the cumsum first, and index to the resulting cumsum matrix.

2 Likes