f61f339dbc1782f7c5cd6cee6e3a5cd4758622bb,neurodsp/aperiodic/dfa.py,,compute_detrended_fluctuation,#Any#Any#Any#,117

Before Change



    // Gather windows & vectorize, so we can call math functions in one go
    n_win = int(np.floor(len(sig) / win_len))
    sig_rect = np.reshape(sig[:n_win * win_len], (n_win, win_len)).T

    // Calculate local trend, as the line of best fit within the time window
    _, fluc, _, _, _ = np.polyfit(np.arange(win_len), sig_rect, deg=deg, full=True)

After Change


    

    // Calculate cumulative sum of the signal & split the signal into segments
    segments = split_signal(sp.cumsum(sig - np.mean(sig)), win_len).T

    // Calculate local trend, as the line of best fit within the time window
    _, fluc, _, _, _ = np.polyfit(np.arange(win_len), segments, deg=deg, full=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: neurodsp-tools/neurodsp
Commit Name: f61f339dbc1782f7c5cd6cee6e3a5cd4758622bb
Time: 2019-10-09
Author: tdonoghue@ucsd.edu
File Name: neurodsp/aperiodic/dfa.py
Class Name:
Method Name: compute_detrended_fluctuation


Project Name: bethgelab/foolbox
Commit Name: b939c910d036d8197ac7c63e5f188bc4c4fc4803
Time: 2019-07-20
Author: rzrolandzimmermann@gmail.com
File Name: foolbox/batching.py
Class Name:
Method Name: run_parallel


Project Name: neurodsp-tools/neurodsp
Commit Name: f61f339dbc1782f7c5cd6cee6e3a5cd4758622bb
Time: 2019-10-09
Author: tdonoghue@ucsd.edu
File Name: neurodsp/aperiodic/dfa.py
Class Name:
Method Name: compute_rescaled_range