pyemma.msm.estimation.log_likelihood

pyemma.msm.estimation.log_likelihood(C, T)

Log-likelihood of the count matrix given a transition matrix.

Parameters:
  • C ((M, M) ndarray or scipy.sparse matrix) – Count matrix
  • T ((M, M) ndarray orscipy.sparse matrix) – Transition matrix
Returns:

logL – Log-likelihood of the count matrix

Return type:

float

Notes

The likelihood of a set of observed transition counts C=(cij) for a given matrix of transition counts T=(tij) is given by

L(C|P)=Mi=1(Mj=1pcijij)

The log-likelihood is given by

l(C|P)=Mi,j=1cijlogpij.

The likelihood describes the probability of making an observation C for a given model P.

Examples

>>> from pyemma.msm.estimation import log_likelihood
>>> T = np.array([[0.9, 0.1, 0.0], [0.5, 0.0, 0.5], [0.0, 0.1, 0.9]])
>>> C = np.array([[58, 7, 0], [6, 0, 4], [0, 3, 21]])
>>> logL = log_likelihood(C, T)
>>> logL
-38.280803472508182
>>> C = np.array([[58, 20, 0], [6, 0, 4], [0, 3, 21]])
>>> logL = log_likelihood(C, T)
>>> logL
-68.214409681430766

References

[1]Prinz, J H, H Wu, M Sarich, B Keller, M Senne, M Held, J D Chodera, C Schuette and F Noe. 2011. Markov models of molecular kinetics: Generation and validation. J Chem Phys 134: 174105