feat(matlab): learning figure + methods write-up + organized CSV data export

Adds make_figure (2-panel learning curves + per-phase slopes, colorblind-safe
Box-B2/Box-A2 palette) -> results/figure_learning.png; analysis/writeup.md
(figure + methods + results summary); and tdcs_export_all/run_export exporting
every data variation into an organized export/ tree (curated_all, scenarios/9,
anchors/3 with tDCS factor, phases/9 + MANIFEST). Adds tExport tests. Suite 36/36.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-20 12:11:37 -04:00
parent e730aa0020
commit 800189371b
30 changed files with 2535 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
# tDCS reaching study — figure and methods
![Learning curves and per-phase learning rate](matlab/results/figure_learning.png)
**Figure 1.** (A) Mean ± SEM successful reaches per session over the common 013
training-day window for the tDCS (Box-B2, blue) and control (Box-A2, green)
groups; the dashed line marks the fast/slow phase boundary. (B) Per-animal
learning slope (mean, 95% CI) in the fast (05) and slow (613) phases.
## Methods
The number of successful reaches per session was modeled as a function of
training day and stimulation condition. Sessions were indexed by training day
(day 0 = the first analyzed day, i.e. the previous study's "Day 1"), and the two
electrode conditions were compared as a binary tDCS factor (Box-B2 = tDCS,
Box-A2 = control; n = 35 animals per group). We fit linear mixed-effects models
(MATLAB R2025b, `fitlme`, Statistics and Machine Learning Toolbox) of the form
`successes ~ day * tDCS + (1 | subject)` with a per-subject random intercept; the
tDCS main effect (day centered at each window's first day) estimates the Day-1
group difference and the day × tDCS interaction estimates the difference in
learning rate. Because the anchor groups' day coverage was unequal over the full
range (Box-A2 data ended ~day 13 while Box-B2 continued), analyses were
restricted to the common 013 window and, to separate acquisition from plateau,
refit within a *fast* (days 05) and *slow* (days 613) phase. Given the small
number of animals, the subject was treated as the unit of inference: per-animal
learning slopes were compared between groups (Welch *t*, MannWhitney) and within
groups across phases (paired *t*); the `fitlme` interaction tests, which use
observation-level degrees of freedom, are anticonservative at this sample size
and are reported only as a reference. Statistical power was estimated by
Monte-Carlo simulation from the fitted early-phase model across a range of
per-group sample sizes and effect sizes. Overall accuracy (successes/attempts)
and counts were additionally modeled with binomial and Poisson GLMMs. All
analysis code, derived datasets, and this figure are in `analysis/matlab/`.
## Results (summary)
Both groups showed strong session-to-session learning (day effect, p < 10⁻¹³),
following a fast-then-slow trajectory (Fig. 1A): steep gains over days 05 that
flattened toward a plateau by day 13. The tDCS and control groups performed
comparably on Day 1 (tDCS main effect n.s.), and the tDCS group acquired faster
during the early phase (Fig. 1B; slope ≈ 15 vs 10 reaches/day; interaction +4.6,
95% CI [+1.0, +8.2]), converging by the late phase. At the subject level this
early-phase difference was a consistent trend but did not reach significance
(Welch p ≈ 0.110.25), and the study was underpowered at n = 35/group (≈3070%
power for the observed effect; ≈8/group would be needed for the observed effect,
≈20/group for half that, to reach 80% power). This is consistent with the
previously reported days × tDCS interaction, here compressed into the early
acquisition phase — plausibly because the improved protocol's higher performance
ceiling leaves little late-phase headroom for a benefit to accumulate.