dynsight.analysis.cross_time_correlation¶
- dynsight.analysis.cross_time_correlation(data, max_delay=None)[source]¶
Computes the mean cross time correlation function for time-series.
Takes as input an array of shape (n_particles, n_frames), where the element [i][t] is the value of some quantity for particle i at time t. For each particles pair, computes the cross time correlation function (cross-TCF). Returns the cross-TCF averaged over all the particles pairs.
- Parameters:
data (NDArray[np.float64]) – Array of shape (n_particles, n_frames).
max_delay (int | None) – The TCF will be computed for all the delay values from zero to max_delay - 1 frames. If None, il will be set to the maximum possible delay. Default is None.
- Returns:
The values of the TCF for all delays from zero to max_delay - 1.
- The stndard error on the TCF for all delays from zero to
max_delay - 1.
- Return type:
tuple[np.ndarray, np.ndarray]
Example
import numpy as np from dynsight.analysis import cross_time_correlation # Create random input np.random.seed(1234) n_particles = 100 n_frames = 100 data = np.random.rand(n_particles, n_frames) time_corr, _ = cross_time_correlation(data)