function indices_by_sequence

deeptime.markov.sample.indices_by_sequence(indices: List[ndarray], sequence)

Samples trajectory/time indices according to the given sequence of states.

Notes

Returns -1 indices for states that are not observed in the current sample.

Parameters:
  • indices (List[np.ndarray]) – For each state, all trajectory and time indices where this state occurs. Each matrix has a number of rows equal to the number of occurrences of the corresponding state, with rows consisting of a tuple (i, t), where i is the index of the trajectory and t is the time index within the trajectory.

  • sequence (array_like of integers) – A sequence of discrete states. For each state, a trajectory/time index will be sampled at which dtrajs have an occurrences of this state

Returns:

indices – The sampled index sequence of shape (N, 2). Index array with a number of rows equal to N=len(sequence), with rows consisting of a tuple (i, t), where i is the index of the trajectory and t is the time index within the trajectory.

Return type:

np.ndarray