deeptime.markov.tools.estimation.log_likelihood¶
- deeptime.markov.tools.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 for a given matrix of transition counts is given by
The log-likelihood is given by
The likelihood describes the probability of making an observation for a given model .
Examples
>>> import numpy as np >>> from deeptime.markov.tools.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.2808034725...
>>> C = np.array([[58, 20, 0], [6, 0, 4], [0, 3, 21]]) >>> logL = log_likelihood(C, T) >>> logL -68.2144096814...
References