deeptime.markov.hmm

Package containing tools for estimation and analysis of hidden Markov state models.

They consist out of a hidden state MSM which holds information on how hidden states can transition between one another and an OutputModel, which maps hidden states to discrete observable states in case of an DiscreteOutputModel or to continuous observables in case of an GaussianOutputModel.

Estimators

MaximumLikelihoodHMM(initial_model, lagtime)

Maximum likelihood Hidden Markov model (HMM) estimator.

BayesianHMM(initial_hmm[, n_samples, ...])

Estimator for a Bayesian Hidden Markov state model.

Output models

OutputModel(n_hidden_states, n_observable_states)

Output model superclass.

DiscreteOutputModel(output_probabilities[, ...])

HMM output probability model using discrete symbols.

GaussianOutputModel(n_states[, means, ...])

HMM output probability model using one-dimensional Gaussians.

Initial guess

Depending on the output model there are some methods that provide initial guesses for estimation.

init.discrete.random_guess(...[, seed])

Initializes a HMM with a set number of hidden and observable states by setting the transition matrix uniform and drawing a random row-stochastic matrix as output probabilities.

init.discrete.metastable_from_data(dtrajs, ...)

Estimates an initial guess HMM from given discrete trajectories.

init.discrete.metastable_from_msm(msm, ...)

Makes an initial guess for an HMM with discrete output model from an already existing MSM over observable states.

init.gaussian.from_data(trajs, ...[, ...])

Makes an initial guess HMM with Gaussian output model.

Models

HiddenMarkovModel(transition_model, output_model)

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.

BayesianHMMPosterior([prior, samples])

Bayesian Hidden Markov model with samples of posterior and prior.