Correlation routines

tidynamics.acf(data)

Autocorrelation function (ACF) of the input data using the Fast Correlation Algorithm.

For D-dimensional time series, a sum is performed on the last dimension.

Parameters:data (array-like) – The input signal, of shape (N,) or (N,D).
Returns:ndarray of shape (N,) with the autocorrelation for successive linearly spaced time delays
tidynamics.msd(pos)

Mean-squared displacement (MSD) of the input trajectory using the Fast Correlation Algorithm.

Parameters:pos (array-like) – The input trajectory, of shape (N,) or (N,D).
Returns:ndarray of shape (N,) with the MSD for successive linearly spaced time delays.
tidynamics.cross_displacement(pos)

Cross displacement of the components of the input trajectory.

Parameters:pos (array-like) – The input trajectory, of shape (N, D).
Returns:list of lists of times series, where the fist two indices [i][j] denote the coordinates for the cross displacement: “(Delta pos[:,i]) (Delta pos[:,j])”.
tidynamics.correlation(data1, data2)

Correlation between the input data using the Fast Correlation Algorithm.

For D-dimensional time series, a sum is performed on the last dimension.

Parameters:
  • data1 (array-like) – The first input signal, of shape (N,) or (N,D).
  • data2 (array-like) – The first input signal, of equal shape as data1.
Returns:

ndarray of shape (2*N-1,) with the correlation for “data1*data2[tau]” where tau is the lag in units of the timestep in the input data. The correlation is given from time -N to time N.