class HiddenMarkovModel

class deeptime.markov.hmm.HiddenMarkovModel(transition_model, output_model: Union[ndarray, OutputModel], initial_distribution: Optional[ndarray] = None, likelihoods: Optional[ndarray] = None, state_probabilities: Optional[List[ndarray]] = None, initial_count: Optional[ndarray] = None, hidden_state_trajectories: Optional[Iterable[ndarray]] = None, stride: Union[int, str] = 1, observation_symbols: Optional[ndarray] = None, observation_symbols_full: Optional[ndarray] = None)

Hidden Markov state model consisting of a transition model (MSM) on the hidden states, an output model which maps from the hidden states to a distribution of observable states, and optionally an initial distribution on the hidden states. Some properties require a crisp assignment to states in the observable space, in which case only a discrete output model can be used.

Parameters:
  • transition_model ((m,m) ndarray or MarkovStateModel) – Transition matrix for hidden (macro) states

  • output_model ((m,n) ndarray or OutputModel) – observation probability matrix from hidden to observable (micro) states or OutputModel instance which yields the mapping from hidden to observable state.

  • initial_distribution ((m,) ndarray, optional, default=None) – Initial distribution of the hidden (macro) states. Default is uniform.

  • likelihoods ((k,) ndarray, optional, default=None) – Likelihood progression of the HMM as it was trained for k iterations with Baum-Welch.

  • state_probabilities (list of ndarray, optional, default=None) – List of state probabilities for each trajectory that the model was trained on (gammas).

  • initial_count (ndarray, optional, default=None) – Initial counts of the hidden (macro) states, computed from the gamma output of the Baum-Welch algorithm

  • hidden_state_trajectories (list of ndarray, optional, default=None) – When estimating the HMM the data’s most likely hidden state trajectory is determined and can be saved with the model by providing this argument.

  • stride (int or str('effective'), optional, default=1) – Stride which was used to subsample discrete trajectories while estimating a HMM. Can either be an integer value which determines the offset or ‘effective’, which makes an estimate of a stride at which subsequent discrete trajectory elements are uncorrelated.

  • observation_symbols (array_like, optional, default=None) – Sorted unique symbols in observations. If None, it is assumed that all possible observations are made and the state symbols are set to an iota range over the number of observation states.

  • observation_symbols_full (array_like, optional, default=None) – Full set of symbols in observations. If None, it is assumed to coincide with observation_symbols.

References

[1] (1,2,3)

Frank Noé, Hao Wu, Jan-Hendrik Prinz, and Nuria Plattner. Projected and hidden markov models for calculating kinetics and metastable states of complex molecules. The Journal of chemical physics, 139(18):11B609_1, 2013.