Giter Site home page Giter Site logo

Comments (2)

Freihaut avatar Freihaut commented on June 15, 2024 1

Thank you for the thorough explanation. I really appreciate it!
I understand your concern about the potential problems of comparing sample entropy values from trials with different r-tresholds, thanks for highlighting it. After looking at sample_entropy for some now, I think that it is a less straightforward to interpret parameter (with many tuning options), which also produces NaN-values or Inf-values for some trials. So I might stick with x- & y-flips, angles and straight line deviations for potential movement-accuracy measures of a simple point-and-click task.

from mousetrap.

PascalKieslich avatar PascalKieslich commented on June 15, 2024

Hi there,

that's a good point! I'll try to address it in several steps:

1) Current implementation

Yes, the implementation is as you describe it ("you calculate r using the standard deviation of the x-position difference data across all trials") and as intended (i.e., not a bug).

2) Rationale behind it

I tried to implement sample entropy like Hehman et al. (2015) described it. I agree with you that the description in the paper is not very explicit "... within a tolerance of .2 multiplied by the standard deviation of the x-shifts (the method employed
in our Python script in the Supplementary Material)" (p. 394). But, as you pointed out, this becomes more clear in the supplementary material ("Recommended tolerance r is the standard deviation of x-shifts (Δx) across conditions"). They also provide a link to a Python script within the supplementary material (https://github.com/rystoli/psychtools/blob/master/MT/SampEn.py). Unfortunately, this file does not seem to be online anymore but back in the day, when I implemented the function, I downloaded their script and this included an example code which, to my understanding, makes it explicit that they intended the SD to be computed across all trials:

#make fake test trajectories: 
#typical = sort([randint(0,150)*.01 for i in xrange(101)])
#atypical = sort([randint(0,150)*.01 for i in xrange(101)])
#sample call: SampEn(typical,3,.2*std(xshifts(typical)+xshifts(atypical)))

3) Which approach is better?

To be honest, I don't have a strong opinion on that as I never really used sample entropy in my own research projects (when I was still doing research). However, I believe that the approach that you describe has one drawback in that the sample entropy values are less comparable between trials if you vary the tolerance value (r) between trials. I see that it could make sense to compute the SD per trial, but maybe one could then average the SD values across trials in a second step and use this average SD as the tolerance value for all trials?

Best,

Pascal

from mousetrap.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.