You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compared the libraries:antropy, pyentrp, EntropyHub。
For example, calculate Sample Entropy, all not the same value。
Isn't the algorithm the same?
import antropy as ant
entropy1_5 = ant.sample_entropy(X)
from pyentrp import entropy as ent
entropy2_2 = ent.sample_entropy(X, 2)
import EntropyHub as EH
Samp, _, _ = EH.SampEn(X)
I believe the differences in Sample Entropy values are due to variations in how each library implements the algorithm. You might want to check if the parameters you're passing are consistent across the libraries. There might be some small numerical differences as well.
On a 16-point binary fixture, the exact pyentrp and Antropy Python function bodies agreed at 0.693147 after this alignment; independent pair counts were 20 and 10. That was source-isolated execution with Antropy's JIT decorator removed, not installed-package or EntropyHub execution. Pyentrp counts prefixes of complete longest-template windows, so changing sample_length also changes which tail templates participate. Matching settings does not guarantee equality across versions and boundary conventions; your X and installed versions are still needed for any remaining difference.
Activity
nikdon commentedon Aug 12, 2024
I believe the differences in Sample Entropy values are due to variations in how each library implements the algorithm. You might want to check if the parameters you're passing are consistent across the libraries. There might be some small numerical differences as well.
drkotireddysaripalli commentedon Oct 8, 2026
These calls select different quantities in the current sources:
sample_length=m+1, returns a vector, and defaults tor=0.1*std(X). Thussample_entropy(X, 2)does not include the order-2 estimate.r=0.2*std(X).Sampas orders 0 throughm; use its order-2 element.To compare order 2 with the same explicit radius on the same unmodified
X:On a 16-point binary fixture, the exact pyentrp and Antropy Python function bodies agreed at
0.693147after this alignment; independent pair counts were 20 and 10. That was source-isolated execution with Antropy's JIT decorator removed, not installed-package or EntropyHub execution. Pyentrp counts prefixes of complete longest-template windows, so changingsample_lengthalso changes which tail templates participate. Matching settings does not guarantee equality across versions and boundary conventions; yourXand installed versions are still needed for any remaining difference.Affiliation: Chief Scientist PinnacleAI(R), Pinnacle Blooms Network of Bharath Healthcare P LIMITED, https://www.pinnacleblooms.org/verify