# Correlation routines¶

tidynamics.acf(data)

Autocorrelation of the input data using the Fast Correlation Algorithm.

Computes the autocorrelation for all time lags in the input data. The numerical results for large lags contain fewer samples than for short lags and are not accurate. This is intrinsic to the computation and not a limitation of the 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). 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.

Computes the MSD for all possible time deltas in the trajectory. The numerical results for large time deltas contain fewer samples than for small time times and are less accurate. This is intrinsic to the computation and not a limitation of the algorithm.

Parameters: pos (array-like) – The input trajectory, of shape (N,) or (N,D). 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). 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. 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.