2.2.4. Permutation Auto Mutual Information (PAMI) for time delay (tau)
This function implements the mulutal information of permutations to find the delay (tau) that causes the first minima in the mutual information between permutations.
- teaspoon.parameter_selection.PAMI_delay.PAMI_for_delay(ts, n=5, plotting=False)[source]
This function calculates the mutual information between permutations with tau = 1 and tau = delay
- Parameters:
ts (array) – Time series (1d).
- Kwargs:
plotting (bool): Plotting for user interpretation. defaut is False.
n (int): dimension for calculating delay. delault is 5 as explain in On the Automatic Parameter Selection for Permutation Entropy
- Returns:
tau, The embedding delay for permutation formation.
- Return type:
(int)
- teaspoon.parameter_selection.PAMI_delay.mutualPerm(ts, delay, n)[source]
This function calculates the mutual information between permutations with tau = 1 and tau = delay
- Parameters:
ts (array) – Time series (1d).
delay (int) – Permutation delay
n (int) – Permutation dimension
- Returns:
I, Mutual permutation information.
- Return type:
(float)
The following is an example implementing Permutation Auto-Mutual Information for the purpose of selecting tau:
from teaspoon.parameter_selection.PAMI_delay import PAMI_for_delay
import numpy as np
fs = 10
t = np.linspace(0, 100, fs*100)
ts = np.sin(t)
tau = PAMI_for_delay(ts, n = 3, plotting = True)
print('Delay from PAMI: ',tau)
Where the output for this example is:
Permutation Embedding Delay: 8