Commit Graph

14 Commits

Author SHA1 Message Date
Experiments DB Dev 77b631bcac feat(matlab): mergeNaive grouping (control=A2+Naive, tDCS=B2+Right) + GLM/power
Adds cfg.mergeNaive and scenario/paper/phase/power support. This pooled grouping
is the closest replication of the paper's full pattern: paper LME interaction
F(1)=7.30, p=0.008 (paper 7.12/0.008), stim main n.s. (p=0.21 = equal on Day 1),
strong day effect; the overall tDCS advantage is significant at the cluster-honest
per-animal level (rate p=0.003) and well powered. Adds a grouping test. Suite 38/38.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:50:35 -04:00
Experiments DB Dev 7b5c27df8c feat(matlab): verbatim paper LME (behavior ~ stim+day+stim:day+(1|rat)) + power sim on it
Adds tdcs_paper_lme replicating the paper's exact formula/variable names (paper_*
switch cases): mergeA2 reproduces the interaction F(1)=7.09 vs 7.12, p=0.009 vs
0.008, with a coverage-confound warning. Rewrites tdcs_power_sim to fit that same
formula (interaction term canonicalized to day:stim). Adds a replication test.
Suite 37/37.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 12:40:26 -04:00
Experiments DB Dev 800189371b 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>
2026-07-20 12:11:37 -04:00
Experiments DB Dev e730aa0020 feat(matlab): phased days x tDCS LME + Monte-Carlo power analysis
Adds tdcs_phase_lme (same LME refit within learning phases 0-5/6-10/6-13, with
per-phase slopes + interaction 95% CI) as phase_* switch cases, and
tdcs_power_sim (Monte-Carlo power for the early-phase interaction, scored by the
cluster-honest per-animal test and the LME test) + run_power. Findings: the
Box-B2 faster-acquisition signal is in the early phase; at n=3-5/group honest
power is 0.3-0.7 even at the observed effect (need ~8/group if effect is as
observed, ~20/group if half). Adds tPhasePower tests. Suite 35/35.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 11:06:51 -04:00
Experiments DB Dev 89bb95088f feat(matlab): add 0-13 day window (lme_*_d0_13) + coverage warning
Box-A2 has no data past ~day 13, so the full-range days x tDCS interaction
extrapolates A2's slope and is confounded (spuriously significant, wrong sign).
Add the _d0_13 window (equal anchor coverage) and a report warning when the two
groups' day coverage is unequal. In the fair 0-13 window the interaction is n.s.
with a POSITIVE slope diff and the Day-1 tDCS effect is n.s. -- matching the
paper's 'equal on Day 1' direction (underpowered at n=8). Suite 32/32.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 09:58:19 -04:00
Experiments DB Dev f0ce978bd4 docs(matlab): label tDCS main effect as Day 1 (= our day 0), matching the paper
The model already evaluates the tDCS main effect at day 0, which is the paper's
'Day 1'; relabel the report/docstring to state the equivalence explicitly so the
'equal on Day 1' comparison is unambiguous. No model change (re-indexing day
would move the main-effect evaluation point off Day 1). Suite 31/31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 09:46:52 -04:00
Experiments DB Dev 08c14c476c feat(matlab): add linear days x tDCS mixed-model scenarios (lme_*)
Adds 6 switch cases replicating the paper's linear mixed model
success ~ day * tDCS + (1|subject) on the Box-B2(tDCS=1) vs Box-A2(tDCS=0)
arm, reporting the days x tDCS interaction, days, and tDCS effects as t/F/p.
mergeA2_full reproduces the paper's interaction (F=7.09 vs 7.12, p=0.009 vs
0.008); interpretation is sign-aware and honestly notes our data diverges from
the paper (Box-B2 ahead on day 1, gap narrows -- not 'equal on day 1,
accumulates'). Adds tLme tests. Suite 31/31.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 09:43:08 -04:00
Experiments DB Dev b1057f6105 fix(matlab): report learning rate via per-animal slope test, not anticonservative GLMM F-test
fitglme coefTest only offers observation-level DF (df2~=178), which overstates
the group x day interaction significance for this few-subject design (p~=0 in
every scenario). Replace the reported learning-rate result with a cluster-honest
per-animal slope test (per-subject OLS slope of success vs day, Welch + MWU,
B2 vs A2) -- now correctly parallel in all 6 scenarios, matching the Python GEE.
The GLMM F-test is kept as a flagged reference only. Adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 08:40:47 -04:00
Experiments DB Dev 13414d31fc matlab(tdcs): assert reference group present; README scope note
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 08:08:27 -04:00
Experiments DB Dev 01f59a5265 matlab(tdcs): report, switch/case entry, runners, README 2026-07-20 08:00:40 -04:00
Experiments DB Dev 27d388530a matlab(tdcs): GLMM + per-animal + classification models 2026-07-20 07:51:30 -04:00
Experiments DB Dev 75ea8a031e test(matlab): fix uint64 vs double class mismatch in group-count assertion
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 07:43:05 -04:00
Experiments DB Dev e398237c76 matlab(tdcs): scenario derivation + derived data export 2026-07-20 07:39:12 -04:00
Experiments DB Dev 33121e3a8f matlab(tdcs): data loading + curated group map 2026-07-20 07:29:31 -04:00