f61f339dbc1782f7c5cd6cee6e3a5cd4758622bb,neurodsp/aperiodic/dfa.py,,compute_rescaled_range,#Any#Any#,86

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

    // get back the sig by taking the derivative of sig_walk
    X = np.concatenate((sig[:1], np.diff(sig)))
    X_rect = np.reshape(X[:n_win * win_len], (n_win, win_len)).T

    // Calculate rescaled range as range divided by std, and take mean across windows
    rs_win = np.ptp(sig_rect, axis=0) / np.std(X_rect, axis=0)
    rs = np.mean(rs_win)

After Change


    

    // Demean signal
    sig = sig - np.mean(sig)

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

    // Calculate rescaled range as range divided by standard deviation (of non-cumulative signal)
    rs_win = np.ptp(segments, axis=0) / np.std(split_signal(sig, win_len).T, axis=0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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_rescaled_range


Project Name: RaRe-Technologies/gensim
Commit Name: cac5f014c09193f7a5ad6b71e4012defa0a96baa
Time: 2010-09-05
Author: radimrehurek@seznam.cz
File Name: src/gensim/matutils.py
Class Name:
Method Name: corpus2csc


Project Name: RaRe-Technologies/gensim
Commit Name: c55d1b295cb6717ba6494917b88183e8d3f284a9
Time: 2010-09-05
Author: piskvorky@92d0401f-a546-4972-9173-107b360ed7e5
File Name: src/gensim/matutils.py
Class Name:
Method Name: corpus2csc