{"id":468,"date":"2022-03-16T12:22:40","date_gmt":"2022-03-16T10:22:40","guid":{"rendered":"https:\/\/benediktehinger.de\/blog\/science\/?p=468"},"modified":"2022-03-16T12:22:40","modified_gmt":"2022-03-16T10:22:40","slug":"when-the-h0-distribution-of-tfce-is-not-uniform","status":"publish","type":"post","link":"https:\/\/benediktehinger.de\/blog\/science\/when-the-h0-distribution-of-tfce-is-not-uniform\/","title":{"rendered":"When the H0 distribution of TFCE is not uniform"},"content":{"rendered":"\n<p>I wrote about <a href=\"https:\/\/benediktehinger.de\/blog\/science\/threshold-free-cluster-enhancement-explained\/\" data-type=\"post\" data-id=\"340\">Threshold-Free-Cluster-Enhancement (TFCE) before<\/a>, this time I stumbled upon a weirdly looking H0 diagram. Let me explain: If you simulate data without any effect, you expect that the P(data|H0) distribution is uniform, that is, all p-values are equally likely. Here, I define the p-value as the minimal p-value over time that I get from one whole simulation (1000 permutations per simulated dataset) &#8211; I simulated only cluster in time not space (find the notebook <a href=\"http:\/\/benediktehinger.de\/upload\/nb_tfce_H0.html\">here<\/a>, <a href=\"https:\/\/benediktehinger.de\/upload\/nb_tfce_H0.jl\" data-type=\"URL\" data-id=\"https:\/\/benediktehinger.de\/upload\/nb_tfce_H0.jl\">raw-jl here<\/a>). When I did this for 100 repetitions, each applying permutation TFCE and calculating the min-p, I got the following histogram of 100 p-values:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"752\" src=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/image.png\" alt=\"\" class=\"wp-image-469\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/image.png 1023w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/image-300x221.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/image-768x565.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/a><figcaption>TFCE H0 distribution with integration step of 0.4<\/figcaption><\/figure>\n\n\n\n<p>That does not look uniform at all! What is going on? It turns out, that you can get this kind of &#8220;clustering&#8221; if your integration step-size is too large. Indeed, I change the integration step from 0.4 to 0.1<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/grafik.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"750\" src=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/grafik.png\" alt=\"\" class=\"wp-image-470\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/grafik.png 1008w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/grafik-300x223.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2022\/03\/grafik-768x571.png 768w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/a><figcaption>TFCE H0 distribution with integration step 0.1<\/figcaption><\/figure>\n\n\n\n<p>Now it looks much more uniform; I should probably use more repetitions (indeed in full simulations I use 10x as many) &#8211; but this already took 500s and I am not prepared to wait longer \ud83d\ude09<\/p>\n\n\n\n<p>Thanks @Olivier Renauld for this explanation!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wrote about Threshold-Free-Cluster-Enhancement (TFCE) before, this time I stumbled upon a weirdly looking H0 diagram. Let me explain: If you simulate data without any effect, you expect that the P(data|H0) distribution is uniform, that is, all p-values are equally likely. Here, I define the p-value as the minimal p-value over time that I get from one whole simulation (1000 permutations per simulated dataset) &#8211; I simulated only cluster in time not space (find the notebook here, raw-jl here). When I did this for 100 repetitions, each applying permutation TFCE and calculating the min-p, I got the following histogram of&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":0,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"wp:attachment":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}