Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complexity hotfixes #567

Merged
merged 10 commits into from
Nov 2, 2021
Merged

Complexity hotfixes #567

merged 10 commits into from
Nov 2, 2021

Conversation

DominiqueMakowski
Copy link
Member

No description provided.

@DominiqueMakowski
Copy link
Member Author

import neurokit2 as nk

signal = nk.signal_simulate(duration=2, sampling_rate=200, frequency=[5, 6], noise=0.5)

mplzc, info = nk.complexity_lempelziv(signal, delay=7, dimension=3, multiscale=True, show=True)

MPLZC fails as soon as delay get more than like 1 or 2 🤔

@zen-juen
Copy link
Member

import neurokit2 as nk

signal = nk.signal_simulate(duration=2, sampling_rate=200, frequency=[5, 6], noise=0.5)

mplzc, info = nk.complexity_lempelziv(signal, delay=7, dimension=3, multiscale=True, show=True)

MPLZC fails as soon as delay get more than like 1 or 2 🤔

That's because for the final scale factor, the length of the coarse-grained signal (which depends on dimension and the scale factors we use) cannot be shorter than 2 times the delay (so for the above example the final coarsegrained signal has a length of 12 data samples and embedding delay of lower than 12 / 2 = 6 is needed and hence delay=7 raises the embedding error).

On a related note, I found the reviewers report to the original MPLZC paper here. This is the author's response to the reviewers' comments regarding how the role of tau is unclear in the paper:

The unity delay (τ=1) is used to calculate the PLZC of the coarse-grained time series for all scales. There are several methods for determining the optimal time delay, for a single channel. Future developments should test time delay selection for different scales, but these are not yet available.

@DominiqueMakowski
Copy link
Member Author

should we use always delay=1 when coarsegraining?

@zen-juen
Copy link
Member

Yes perhaps we should emphasize in our docstrings to use delay=1 when multiscale=True for now

@DominiqueMakowski
Copy link
Member Author

for the other multiscale measures it just hardcodes delay=1 when doing the coarsegraining (overwriting in the process any other value) we should probably just do the same right?

@zen-juen
Copy link
Member

zen-juen commented Oct 30, 2021

ah yes you're right let's hardcode it then! testing of different delays can be considered further down the road (including exposing a delay arg in entropy_multiscale()) when we need it

@zen-juen zen-juen merged commit 55d1557 into dev Nov 2, 2021
@zen-juen zen-juen deleted the complexity_fixes branch November 2, 2021 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants