2.2.2. Auto-correlation for time delay (tau)
This function implements Auto-Correlation (AC) for the selection of the delay tau for permutation entropy. Additionally, it only requires a single time series and has a fast computation time. However, this method is only designed for linear system.
- teaspoon.parameter_selection.autocorrelation.autoCorrelation_tau(ts, cutoff=0.36788, AC_method='spearman', plotting=False)[source]
This function takes a time series and uses AC to find the optimum delay based on the correlation being less than a specified cutoff (default is 1/e, which is approximately 0.36788).
- Parameters:
ts (array) – Time series (1d).
cutoff (float) – value for which correlation is considered insignificant (default is 1/e).
method (string) – either ‘spearman’ or ‘pearson’. default is ‘spearman’.
- Kwargs:
plotting (bool): Plotting for user interpretation. defaut is False.
- Returns:
tau, The embedding delay for permutation formation.
- Return type:
(int)
The following is an example implementing autocorrelation for selecting tau:
from teaspoon.parameter_selection.autocorrelation import autoCorrelation_tau
import numpy as np
fs = 10
t = np.linspace(0, 100, fs*100)
ts = np.sin(t) + np.sin((1/np.pi)*t)
tau = autoCorrelation_tau(ts, cutoff = 1/np.exp(1), AC_method = 'pearson', plotting = False)
print('Delay from AC: ', tau)
Where the output for this example is:
Delay from AC: 13