msmbuilder.msm_analysis.sample

msmbuilder.msm_analysis.sample(transition_matrix, state, steps, traj=None, force_dense=False)[source]

Generate a random sequence of states by propogating a transition matrix.

Parameters:

transition_matrix : sparse or dense matrix

A transition matrix

State : {int, None, ndarray}

Starting state for trajectory. If State is an integer, it will be used as the initial state. If State is None, an initial state will be randomly chosen from an uniform distribution. If State is an array, it represents a probability distribution from which the initial state will be drawn. If a trajectory is specified (see Traj keyword), this variable will be ignored, and the last state of that trajectory will be used.

Steps : int

How many steps to generate.

Traj : list, optional

An existing trajectory (python list) can be input; results will be appended to it

ForceDense : bool, deprecated

Force dense arithmatic. Can speed up results for small models (OBSOLETE).

Returns:

Traj : list

Sequence of states as a python list

Versions