dynsight.analysis.self_time_correlation

dynsight.analysis.self_time_correlation(data, max_delay=None)[source]

Computes the mean self 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 particle, computes the self time correlation function (self-TCF). Returns the self-TCF averaged over all the particles, normalized so that the value at t = 0 is equal to 1.

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 self_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, _ = self_time_correlation(data)