msmbuilder.MSMLib.get_count_matrix_from_assignments

msmbuilder.MSMLib.get_count_matrix_from_assignments(assignments, n_states=None, lag_time=1, sliding_window=True)[source]

Calculate counts matrix from assignments.

Parameters:

assignments : ndarray

A 2d ndarray containing the state assignments.

n_states : int, optional

Can be automatically determined, unless you want a model with more states than are observed

lag_time: int, optional :

the LagTime with which to estimate the count matrix. Default: 1

sliding_window: bool, optional :

Use a sliding window. Default: True

Returns:

counts : sparse matrix

Counts[i,j] stores the number of times in the assignments that a trajectory went from state i to state j in LagTime frames

Notes

assignments are input as iterables over numpy 1-d arrays of integers. For example a 2-d array where assignments[i,j] gives the ith trajectory, jth frame. The beginning and end of each trajectory may be padded with negative ones, which will be ignored. If the number of states is not given explitly, it will be determined as one plus the largest state index of the Assignments. Sliding window yields non-independent samples, but wastes less data.