Construct a hidden Markov model (HMM) from spin label side chain dihedrals obtained from MD simulations.
HMM = mdhmm(dihedrals,dt,nStates,nLag) HMM = mdhmm(dihedrals,dt,nStates,nLag,Opt)
mdhmm
takes the trajectories of dihedral angles provided in dihedrals
and builds a Gaussian hidden Markov model (HMM) that stochastically models these trajectories.
mdhmm
accepts up to five input arguments
dihedrals
: trajectory or trajectories of dihedrals
dt
: time step (in seconds) of the dihedral trajectory
nStates
: desired number of states for the HMM
nLag
: desired lag time for the HMM, as a multiplication factor for dt
Opt
: simulation options
The possible fields in the structure Opt
are
Verbosity
isSeeded
true
, use systematic seeds for the clustering of the dihedral angles. If set to false
, use random seeds.
nTrials
If no input argument is given, a short help summary is shown (same as when typing help cardamom
).
mdhmm
returns a structure with information about the Gaussian HMM. It has the following fields
TransProb
eqDistr
mu
Sigma
viterbiTraj
tauRelax
logLik
mdhmm
uses k-means clustering to determine an initial set of state centers and covariance matrices, and a maximum-likelihood estimator to obtain initial estimates for the transition probability matrix and the initial distribution. It then uses these estimates as starting values to optimize them, using the Baum-Welch expectation maximization algorithm. This yields the final HMM parameters. At the end, the most likely state trajectory giving rise to the dihedral trajectory is calculated using the Viterbi algorithm, and the relaxation times of the HMM are calculated from the eigenvalues of the transition probability matrix.
For diagnostics purposes, the log-likelihood exhibited by the set of HMM parameter values throughout model optimization is also provided.
cardamom, mdload, stochtraj_diffusion, stochtraj_jump