msm
Create Markov State Model.
This submodule contains all methods related to estimate the Markov state model.
estimate_markov_model(trajs, lagtime)
¶
Estimates Markov State Model.
This method estimates the MSM based on the transition count matrix.
Parameters:
-
trajs
(StateTraj or list or ndarray or list of ndarray
) –State trajectory/trajectories used to estimate the MSM.
-
lagtime
(int
) –Lag time for estimating the markov model given in [frames].
Returns:
-
T
(ndarray
) –Transition probability matrix \(T_{ij}\), containing the transition probability transition from state \(i o j\).
-
states
(ndarray
) –Array holding states corresponding to the columns of \(T_{ij}\).
Source code in src/msmhelper/msm/msm.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
row_normalize_matrix(mat)
¶
Row normalize the given 2d matrix.
Parameters:
-
mat
(ndarray
) –Matrix to be row normalized.
Returns:
-
mat
(ndarray
) –Normalized matrix.
Source code in src/msmhelper/msm/msm.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
equilibrium_population(tmat, allow_non_ergodic=True)
¶
Calculate equilibirum population.
If there are non ergodic states, their population is set to zero.
Parameters:
-
tmat
(ndarray
) –Quadratic transition matrix, needs to be ergodic.
-
allow_non_ergodic
(bool
, default:True
) –If True only the largest ergodic subset will be used. Otherwise it will throw an error if not ergodic.
Returns:
-
peq
(ndarray
) –Equilibrium population of input matrix.
Source code in src/msmhelper/msm/msm.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|