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

SampEn and MSE frequently report "inf" values #15

Open
hasibagen opened this issue Oct 18, 2024 · 0 comments
Open

SampEn and MSE frequently report "inf" values #15

hasibagen opened this issue Oct 18, 2024 · 0 comments

Comments

@hasibagen
Copy link

Hello,

I've been using the EntropyHub package to compute Sample Entropy (SampEn) and Multiscale Sample Entropy (MSE) for EEG and fMRI data. However, I've encountered frequent occurrences where these functions return "inf" values.

Sample details:

I generated synthetic data to test this:

np.random.seed(42)
n_samples = 2000
time = np.linspace(-30, 60, n_samples)

hbo_signal = (
    0.2 * np.sin(0.2 * time)
    + 0.1 * np.sin(0.05 * time)
    + 0.03 * np.random.normal(size=n_samples)
)
hbr_signal = -0.1 * np.sin(0.2 * time) + 0.05 * np.random.normal(size=n_samples)

Mobj = EH.MSobject("SampEn")
MSx, CI = EH.MSEn(hbo_signal, Mobj, Scales=5, Methodx="modified")

While trying to compute SampEn, the result often comes back as "inf" for certain scales.
Question: Why are SampEn and MSE reporting "inf" values so frequently, and is there a way to prevent this issue from occurring? I've observed this both with real and synthetic data, and the issue persists across different packages.

Your help or guidance would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant