deeptime.markov.tools.analysis.correlation¶
- deeptime.markov.tools.analysis.correlation(T, obs1, obs2=None, times=(1,), k=None, ncv=None)¶
Time-correlation for equilibrium experiment. [1]
- Parameters:
T ((M, M) ndarray or scipy.sparse matrix) – Transition matrix
obs1 ((M,) ndarray) – Observable, represented as vector on state space
obs2 ((M,) ndarray (optional)) – Second observable, for cross-correlations
times (array-like of int (optional), default=(1)) – List of times (in tau) at which to compute correlation
k (int (optional)) – Number of eigenvalues and eigenvectors to use for computation
ncv (int (optional)) – The number of Lanczos vectors generated, ncv must be greater than k; it is recommended that ncv > 2*k
- Returns:
correlations (ndarray) – Correlation values at given times
times (ndarray, optional) – time points at which the correlation was computed (if return_times=True)
References
Notes
Auto-correlation
The auto-correlation of an observable for a system in equilibrium is
is the observable at time . It can be propagated forward in time using the t-step transition matrix .
The propagated observable at time is .
Using the eigenvlaues and eigenvectors of the transition matrix the autocorrelation can be written as
Cross-correlation
The cross-correlation of two observables , is similarly given
Examples
>>> import numpy as np >>> from deeptime.markov.tools.analysis import correlation
>>> T = np.array([[0.9, 0.1, 0.0], [0.5, 0.0, 0.5], [0.0, 0.1, 0.9]]) >>> a = np.array([1.0, 0.0, 0.0]) >>> times = np.array([1, 5, 10, 20])
>>> corr = correlation(T, a, times=times) >>> corr array([0.40909091, 0.34081364, 0.28585667, 0.23424263])