# Parallelism Strategies for Big Data Delayed Transfer Entropy Evaluation
## 2 Initial Concepts
### Algorithms  
At this subsection, the algorithms used during the parallel DTE evaluation are presented. The first one is _surrogate_ algorithm that was used to infer significance level in our analysis. The second was _delayed transfer entropy_ used to estimate the causal interaction among signals presented in our dataset.  
Surrogate  
The word _surrogate_ stands for something that is used instead of something else. In the case of surrogate signals [70], the synthetic data used are randomly generated, but it also presents some characteristics of the original signal that is taking place. A surrogate has the same power spectrum that the original data, but these two signals are uncorrelated. Different computational packages present algorithms to generate surrogate signals [71; 72]. The Amplitude Adjusted Fourier Transform (AAFT) method explained in [PERSON] et al. [73] proposes rescaling the original data to a Gaussian distribution using fast Fourier transform (FFT) phases' randomization and inverse rescaling. This procedure introduces some bias and [PERSON] et al. [73] showed a method to remove it by adjusting the spectrum from surrogates, named Iterative Amplitude Adjusted Fourier Transform (IAAFT) [PERSON] et al. [73] and is displayed in Algorithm 1.  
Surrogate data represent, as best as possible, all the characteristics of the real process, though without causal interactions.  
```
1:original_frequency_bins \(\leftarrow\) FFT(original_signal)
2:original_frequency_amplitude \(\leftarrow\) abs(original_frequency_bins)
3:original_frequency_phase \(\leftarrow\) phase(original_frequency_bins)
4:permuted_signal \(\leftarrow\) random_permutation(original_signal)
5:permuted_frequency_bins \(\leftarrow\) FFT(permuted_signal)
6:permuted_frequency_amplitude \(\leftarrow\) abs(permuted_frequency_bins)
7:while num_step \(<\) max_steps do
8:permuted_frequency_phase \(\leftarrow\) phase(permuted_frequency_bins)
9:new_frequency_bins \(\leftarrow\) original_frequency_amplitude*exp(\(\sharp\)'permuted_frequency_phase)
10:new_signal \(\leftarrow\) IFFT(new_frequency_bins)
11:permuted_signal \(\leftarrow\) swap_vauses(original_signal, new_signal)
12:permuted_frequency_bins \(\leftarrow\) FFT(permuted_signal)
13:permuted_frequency_amplitude \(\leftarrow\) abs(permuted_frequency_bins)
14:current_error \(\leftarrow\) error(permuted_frequency_amplitude,original_frequency_amplitude))
15:ifnum_step = 0 then
16: min_error = current_error
17:endif
18:ifcurrent_error \(<\) min_error then
19:min_error = current_error
20:best_result = real(new_signal)
21:endif
22:ifnum_step \(>\) 0 and abs(last_error-current_error) \(<\) stop_tolerance then
23:return best_result
24:endif
25:endwhile
```  
**Algorithm 1** IAAFT  
In the case of neurophysiological data, the causal association happens in phase synchronization [74]. [PERSON] et al. [13] used a surrogate data with the IAAFT (Iterative Amplitude Adjusted Fourier Transform) algorithm [75], which generates signals preserving the power density spectrum and probability density functions, but with the phase components randomly shuffled [76].  
The importance of surrogate repetitions number is explicitly derived from Equation (1) [77],  
\[n=\frac{K}{\alpha}-1, \tag{1}\]  
where the amount of surrogate repetitions \(n\) is inverse proportional to the desired significance level \(\alpha\), and \(k=1\) for a one-sided hypothesis test or \(k=2\) for a two-sided hypothesis test. A full diagram of surrogate with DTE is presented in Figure 1.