Skip to content

Commit 04bb3d2

Browse files
author
Documenter.jl
committed
build based on d02dc00
1 parent 29d2b62 commit 04bb3d2

File tree

15 files changed

+39
-39
lines changed

15 files changed

+39
-39
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.11.7","generation_timestamp":"2025-10-01T08:15:02","documenter_version":"1.14.1"}}
1+
{"documenter":{"julia_version":"1.11.7","generation_timestamp":"2025-10-03T16:08:16","documenter_version":"1.14.1"}}
-201 KB
Binary file not shown.
195 KB
Loading

dev/generated/reference/type1/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
MersenneTwister(r),
2222
design,
2323
signal,
24-
UniformOnset(; offset=5, width=4),
24+
NoOnset(),
2525
RedNoise(noiselevel=1);
2626
return_epoched=true,
2727
)
2828
data = reshape(data, size(data, 1), :)
29-
data = data[:, evts.condition.=="small"] .- data[:, evts.condition.=="large"]
29+
data_diff = data[:, evts.condition.=="small"] .- data[:, evts.condition.=="large"]
3030

3131
return data,
32-
clusterdepth(data'; τ=quantile(TDist(n_subjects - 1), 0.975), nperm=1000, show_warnings=false)
33-
end;</code></pre><h2 id="Understanding-the-simulation"><a class="docs-heading-anchor" href="#Understanding-the-simulation">Understanding the simulation</a><a id="Understanding-the-simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Understanding-the-simulation" title="Permalink"></a></h2><p>let&#39;s have a look at the actual data by running it once, plotting condition wise trials, the ERP and histograms of uncorrected and corrected p-values</p><pre><code class="language-julia hljs">data, pval = run_fun(5)
32+
clusterdepth(data_diff; τ=quantile(TDist(n_subjects - 1), 0.975), nperm=4000, show_warnings=false)
33+
end;</code></pre><h2 id="Understanding-the-simulation"><a class="docs-heading-anchor" href="#Understanding-the-simulation">Understanding the simulation</a><a id="Understanding-the-simulation-1"></a><a class="docs-heading-anchor-permalink" href="#Understanding-the-simulation" title="Permalink"></a></h2><p>let&#39;s have a look at the actual data by running it once, plotting condition wise trials, the ERP and histograms of uncorrected and corrected p-values</p><pre><code class="language-julia hljs">data, pval = run_fun(1)
3434
conditionSmall = data[:, 1:2:end]
3535
conditionLarge = data[:, 2:2:end]
3636
pval_uncorrected =
@@ -39,7 +39,7 @@
3939
TDist(n_subjects - 1),
4040
abs.(ClusterDepth.studentt(conditionSmall .- conditionLarge)),
4141
)
42-
sig = pval_uncorrected .&lt;= 0.025;</code></pre><p>For the uncorrected p-values based on the t-distribution, we get a type1 error over &quot;time&quot;:</p><pre><code class="language-julia hljs">mean(sig)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">0.168141592920354</code></pre><div class="admonition is-info" id="Note-f01acb8e6031b57e"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-f01acb8e6031b57e" title="Permalink"></a></header><div class="admonition-body"><p>Type-I error is not the FWER (family wise error rate). FWER is the property of a set of tests (in this case tests per time-point), we can calculate it by repeating such tests, and checking for each repetition whether any sample of a repetition is significant (e.g. <code>any(sig)</code> followed by a <code>mean(repetitions_anysig)</code>).</p></div></div><pre><code class="language-julia hljs">f = Figure();
42+
sig = pval_uncorrected .&lt;= 0.025;</code></pre><p>For the uncorrected p-values based on the t-distribution, we get a type1 error over &quot;time&quot;:</p><pre><code class="language-julia hljs">mean(sig)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">0.017699115044247787</code></pre><div class="admonition is-info" id="Note-f01acb8e6031b57e"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-f01acb8e6031b57e" title="Permalink"></a></header><div class="admonition-body"><p>Type-I error is not the FWER (family wise error rate). FWER is the property of a set of tests (in this case tests per time-point), we can calculate it by repeating such tests, and checking for each repetition whether any sample of a repetition is significant (e.g. <code>any(sig)</code> followed by a <code>mean(repetitions_anysig)</code>).</p></div></div><pre><code class="language-julia hljs">f = Figure();
4343
series!(Axis(f[1, 1], title=&quot;condition==small&quot;), conditionSmall&#39;, solid_color=:red)
4444
series!(Axis(f[1, 2], title=&quot;condition==large&quot;), conditionLarge&#39;, solid_color=:blue)
4545
ax = Axis(f[2, 1:2], title=&quot;ERP (mean over trials)&quot;)
@@ -53,11 +53,11 @@
5353

5454
hist!(Axis(f[3, 1], title=&quot;uncorrected pvalues&quot;), pval_uncorrected, bins=0:0.01:1.1)
5555
hist!(Axis(f[3, 2], title=&quot;clusterdepth corrected pvalues&quot;), pval, bins=0:0.01:1.1)
56-
f</code></pre><img src="8c918a6e.png" alt="Example block output"/><h2 id="Run-simulations"><a class="docs-heading-anchor" href="#Run-simulations">Run simulations</a><a id="Run-simulations-1"></a><a class="docs-heading-anchor-permalink" href="#Run-simulations" title="Permalink"></a></h2><p>This takes some seconds (depending on your infrastructure)</p><pre><code class="language-julia hljs">reps = 500
56+
f</code></pre><img src="92f9659c.png" alt="Example block output"/><h2 id="Run-simulations"><a class="docs-heading-anchor" href="#Run-simulations">Run simulations</a><a id="Run-simulations-1"></a><a class="docs-heading-anchor-permalink" href="#Run-simulations" title="Permalink"></a></h2><p>This takes some seconds (depending on your infrastructure)</p><pre><code class="language-julia hljs">reps = 500
5757
res = fill(NaN, reps, 2)
5858
Threads.@threads for r = 1:reps
5959
data, pvals = run_fun(r)
60-
res[r, 1] = mean(pvals .&lt;= 0.05 / 2)
60+
res[r, 1] = mean(pvals .&lt;= 0.05)
6161
res[r, 2] =
6262
mean(abs.(ClusterDepth.studentt(data)) .&gt;= quantile(TDist(n_subjects - 1), 0.975))
63-
end;</code></pre><p>Finally, let&#39;s calculate the percentage of simulations where we find a significant effect somewhere</p><pre><code class="language-julia hljs">mean(res .&gt; 0, dims=1) |&gt; x -&gt; (:clusterdepth =&gt; x[1], :uncorrected =&gt; x[2])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(:clusterdepth =&gt; 0.1, :uncorrected =&gt; 1.0)</code></pre><p>Nice, correction seems to work in principle :) Clusterdepth is not necessarily exactly 5%, but with more repetitions we should get there (e.g. with 5000 repetitions, we got 0.051%).</p><div class="admonition is-info" id="Info-f4cd68306325666c"><header class="admonition-header">Info<a class="admonition-anchor" href="#Info-f4cd68306325666c" title="Permalink"></a></header><div class="admonition-body"><p>if you look closely, the <code>:uncorrected</code> value (can be around 60%) is not as bad as the 99% promised in the introduction. This is due to the correlation between the tests introduced by the noise. Indeed, a good exercise is to repeat everything, but put <code>RedNoise</code> to <code>WhiteNoise</code></p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../../howto/R_betweengroups/">« R: Between groups</a><a class="docs-footer-nextpage" href="../type1_troendle/">Troendle FWER »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 1 October 2025 08:15">Wednesday 1 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
63+
end;</code></pre><p>Finally, let&#39;s calculate the percentage of simulations where we find a significant effect somewhere</p><pre><code class="language-julia hljs">mean(res .&gt; 0, dims=1) |&gt; x -&gt; (:clusterdepth =&gt; x[1], :uncorrected =&gt; x[2])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(:clusterdepth =&gt; 0.044, :uncorrected =&gt; 1.0)</code></pre><p>Nice, correction seems to work in principle :) Clusterdepth is not necessarily exactly 5%, but with more repetitions we should get there (e.g. with 5000 repetitions, we got 0.051%).</p><div class="admonition is-info" id="Info-f4cd68306325666c"><header class="admonition-header">Info<a class="admonition-anchor" href="#Info-f4cd68306325666c" title="Permalink"></a></header><div class="admonition-body"><p>if you look closely, the <code>:uncorrected</code> value (can be around 60%) is not as bad as the 99% promised in the introduction. This is due to the correlation between the tests introduced by the noise. Indeed, a good exercise is to repeat everything, but put <code>RedNoise</code> to <code>WhiteNoise</code></p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../../howto/R_betweengroups/">« R: Between groups</a><a class="docs-footer-nextpage" href="../type1_troendle/">Troendle FWER »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 3 October 2025 16:08">Friday 3 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/generated/reference/type1_troendle/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838

3939
hist!(Axis(f[3, 1], title=&quot;troendle corrected&quot;), pvals_all[:, 1, :][:], bins=0:0.01:1.1)
4040
hist!(Axis(f[3, 2], title=&quot;uncorrected&quot;), pvals_all[:, 2, :][:], bins=0:0.01:1.1)
41-
f</code></pre><img src="2491e191.png" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../type1/">« Clusterdepth FWER</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 1 October 2025 08:15">Wednesday 1 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
41+
f</code></pre><img src="2491e191.png" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../type1/">« Clusterdepth FWER</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 3 October 2025 16:08">Friday 3 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
-81.2 KB
Binary file not shown.
81.2 KB
Loading

dev/generated/tutorials/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
h2 = scatter!(1.2:40.2, pvals2, color = &quot;red&quot;, label = &quot;naive&quot;)
3535
#hlines!(([0.05]))
3636
axislegend()
37-
f</code></pre><img src="64c963f6.png" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Wednesday 1 October 2025 08:15">Wednesday 1 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
37+
f</code></pre><img src="9758ae49.png" alt="Example block output"/><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 3 October 2025 16:08">Friday 3 October 2025</span>. Using Julia version 1.11.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)