Fitting multiple cones to 2D data, how to impose ordering constraint on parameters

No what I mean is that since I am using apex_indices as indices, say something of the form

measurement_coordinates[apex_indices,:]

cumsum will exceed the bounds of the array measurement_coordinates. As an example lets say measurement_coordinate is 6 x 2 and apex_indices sampled from 0 to 5 two independent numbers and it gets [2,5] then cumsum would be [2,7] with the last index exceeding the array. I guess I could try capping it with pm.math.minimum but I wonder if there is a less hacky way to get this done. One thing that comes to mind is to make the array circular but then that beats the purpose of the order constraint completely :slight_smile: