Skip to content

Instantly share code, notes, and snippets.

@jaimeide
Last active December 28, 2023 12:22
Show Gist options
  • Save jaimeide/a9cba18192ee904307298bd110c28b14 to your computer and use it in GitHub Desktop.
Save jaimeide/a9cba18192ee904307298bd110c28b14 to your computer and use it in GitHub Desktop.
Python implementation of the Detrended Partial Cross-Correlation Analysis (DPCCA) coefficient
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ogreyesp
Copy link

Hi,

I want to thank you for the code, it was very helpful for me. I have only one question.... I have read that the profiles should be divided in non-overlapping segments. However, the sliding_window function creates overlapping windows. Is it correct? Should I use overlapping or non-overlapping windows?

Best regards
Oscar

@CNelias
Copy link

CNelias commented Dec 18, 2019

In the original implementation, the authors use overlapping segment. I guess it depends on how many datapoints you have at disposal, using overlapping segment allows you to have more averaging and reduces the variance but can augment the bias due to the fact that the segments are not independant anymore.

@dokato
Copy link

dokato commented Apr 8, 2020

hey @johncwok , shouldn't that be called on summulative sum instead?

k = 6
corr,parCorr,dcca, dpcca = compute_dpcca_others(xx,k)

EDIT: oh no sorry, you simply miss this line in the function:

xx = np.cumsum(cdata,axis=0)

@jaimeide
Copy link
Author

jaimeide commented Jul 1, 2020

Hi Oscar, John and dokato. Thanks for all the comments!
Apologies for the typo. In fact, I missed the line "xx = np.cumsum(cdata,axis=0)" in the final function.
I've now included it in the edited version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment