trentool / TRENTOOL3

Open-Source MATLAB toolbox for transfer entropy estimation
http://trentool.github.io/TRENTOOL3/
GNU General Public License v3.0
56 stars 26 forks source link

minimum number of trials #28

Open Fatima-h22 opened 6 years ago

Fatima-h22 commented 6 years ago

Hi I have EEG data of 2 groups in rest condition(16 individual in every group) and I'm going to calculate TE by Trentool for these two. I used GroupAnlysis to have comon dimension for all. There is a problem with trial number: As my data recorded in rest with no task I set cfgTEGP.minnrtrials=1; but during running the code following warning is appeared: The number of trials/subjects (1) is too small to allow for a sufficient number of permutations given the alpha level (0.05) and necessary corrections for multiple comparisons! and then by investigating the results of "InteractionDelayReconstruction_calculate" I see that -TEmat_sur and TEmat are completely equal! -ALL my TE values in TEmat are Negative!!!

I can not understand what is the problem. any help would be appreciated. thanks

mwibral commented 6 years ago

Hi Fatima,

you need to cut your resting state data into segments (e.g. 2 seconds long) to create more than 1 trial. This is because the surrogate-data based statistics needs it.

Best,

Michael

On 20.07.2018 17:42, Fatima-h22 wrote:

Hi I have EEG data of 2 groups in rest condition(16 individual in every group) and I'm going to calculate TE by Trentool for these two. I used GroupAnlysis to have comon dimension for all. There is a problem with trial number: As my data recorded in rest with no task I set cfgTEGP.minnrtrials=1; but during running the code following warning is appeared: The number of trials/subjects (1) is too small to allow for a sufficient number of permutations given the alpha level (0.05) and necessary corrections for multiple comparisons! and then by investigating the results of "InteractionDelayReconstruction_calculate" I see that TEmat_sur and TEmat are completely equal! ALL my TE values in TEmat are Negative!!! I can not understand what is the problem. any help would be appreciated. thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/trentool/TRENTOOL3/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/AIqYGscGmXXajxG2imiYXIWdyQAVEG9Cks5uIfp3gaJpZM4VYPms.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/trentool/TRENTOOL3","title":"trentool/TRENTOOL3","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/trentool/TRENTOOL3"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"minimum number of trials (#28)"}],"action":{"name":"View Issue","url":"https://github.com/trentool/TRENTOOL3/issues/28"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/trentool/TRENTOOL3/issues/28", "url": "https://github.com/trentool/TRENTOOL3/issues/28", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "minimum number of trials (#28)", "sections": [ { "text": "", "activityTitle": "Fatima-h22", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@Fatima-h22", "facts": [ { "name": "Repository: ", "value": "trentool/TRENTOOL3" }, { "name": "Issue #: ", "value": 28 } ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"trentool/TRENTOOL3\",\n\"issueId\": 28,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"trentool/TRENTOOL3\",\n\"issueId\": 28\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/trentool/TRENTOOL3/issues/28" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 358676908\n}" } ], "themeColor": "26292E" } ]

Fatima-h22 commented 6 years ago

Hi Michael Thank a lot for your answer. I should mention that the length of recorded EEG data is 240sec with 500Hz samplng frequency (i.e.120000 sample) but as EEG is not stationary I segmented my data to 8sec (4000sample) windows and I were going to calculate transfer entropy in each window separately and then average the TE on all windows. Now it seems that was not true.

some cases are not clear for me . May I ask you to clarify please:

1- Is it true that I segment all data and consider every segment as one trial ?

2- As I am using trials, does parameter "cfgTEGP.ensemblemethod" should be set with 'yes' and I should use functions prepared for "ensemble" data??

3-for test I segmented data into two trials as you said, but the problem of negative value for transfer entropy still exist(more than 98% of TE values for different channel combination are negative). what can I do for that? Is it possible it happens because of wrong d,tau and other parameter selection?

3- In your opinion what is a suitable length for window(that is going to be trial) here to have both stationarity and enough data for TE calculation?

thanks in advance

regards

On Wed, Jul 25, 2018 at 5:33 PM mwibral notifications@github.com wrote:

Hi Fatima,

you need to cut your resting state data into segments (e.g. 2 seconds long) to create more than 1 trial. This is because the surrogate-data based statistics needs it.

Best,

Michael

On 20.07.2018 17:42, Fatima-h22 wrote:

Hi I have EEG data of 2 groups in rest condition(16 individual in every group) and I'm going to calculate TE by Trentool for these two. I used GroupAnlysis to have comon dimension for all. There is a problem with trial number: As my data recorded in rest with no task I set cfgTEGP.minnrtrials=1; but during running the code following warning is appeared: The number of trials/subjects (1) is too small to allow for a sufficient number of permutations given the alpha level (0.05) and necessary corrections for multiple comparisons! and then by investigating the results of "InteractionDelayReconstruction_calculate" I see that TEmat_sur and TEmat are completely equal! ALL my TE values in TEmat are Negative!!! I can not understand what is the problem. any help would be appreciated. thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trentool/TRENTOOL3/issues/28#issuecomment-407746810, or mute the thread https://github.com/notifications/unsubscribe-auth/AnjyO0hc5_YfG-G7LMWHnIgptdGD3Wz8ks5uKGyggaJpZM4VYPms .

binbin-liu-git commented 1 year ago

hello, Have you solved the problem of negative TE values? I calculated Transfer Entropy between EMG and EEG signal of an upper limb movement experiment. There are 50 trials for each dataset, and the length of each trail is 1000ms (sampling rate 1000Hz). And all my TE values are also negative and i have no idea how to solve this problem. Hope to get a reply. Thank you!

pwollstadt commented 1 year ago

Hi all, the negative TE values are usually a result of the bias correction inherent to the Kraskov estimator. Have a look at issue 15 where this is dicussed. The FAQ that comes with the JIDT toolbox also provides a nice explanation.