bayespy.utils.random.intervals

bayespy.utils.random.intervals(N, length, amount=1, gap=0)[source]

Return random non-overlapping parts of a sequence.

For instance, N=16, length=2 and amount=4: [0, |1, 2|, 3, 4, 5, |6, 7|, 8, 9, |10, 11|, |12, 13|, 14, 15] that is, [1,2,6,7,10,11,12,13]

However, the function returns only the indices of the beginning of the sequences, that is, in the example: [1,6,10,12]