function timescales¶
- deeptime.markov.tools.analysis.timescales(T, tau=1, k=None, ncv=None, reversible=False, mu=None)¶
Compute implied time scales of given transition matrix.
- Parameters:
T ((M, M) ndarray or scipy.sparse matrix) – Transition matrix
tau (int (optional)) – The time-lag (in elementary time steps of the microstate trajectory) at which the given transition matrix was constructed.
k (int (optional)) – Compute the first k implied time scales.
ncv (int (optional, for sparse T only)) – The number of Lanczos vectors generated, ncv must be greater than k; it is recommended that ncv > 2*k
reversible (bool, optional) – Indicate that transition matrix is reversible
mu ((M,) ndarray, optional) – Stationary distribution of T
- Returns:
ts – The implied time scales of the transition matrix. If k is not None then the shape of ts is (k,).
- Return type:
(M,) ndarray
Notes
The implied time scale \(t_i\) is defined as
\[t_i=-\frac{\tau}{\log \lvert \lambda_i \rvert} \]If reversible=True the the eigenvalues of the similar symmetric matrix sqrt(mu_i / mu_j) p_{ij} will be computed.
The precomputed stationary distribution will only be used if reversible=True.
Examples
>>> import numpy as np >>> from deeptime.markov.tools.analysis import timescales
>>> T = np.array([[0.9, 0.1, 0.0], [0.5, 0.0, 0.5], [0.0, 0.1, 0.9]]) >>> ts = timescales(T) >>> ts array([ inf, 9.49122158, 0.43429448])