Skip to content

feat(mbco_mi): fixed-branch ARIV option + branch-mixing diagnostics - #44

Merged
Data-Wise merged 2 commits into
devfrom
feature/mbco-fixed-branch-ariv
Aug 17, 2026
Merged

feat(mbco_mi): fixed-branch ARIV option + branch-mixing diagnostics#44
Data-Wise merged 2 commits into
devfrom
feature/mbco-fixed-branch-ariv

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

  • medsim_method_mbco_mi() gains ariv = c("own", "fixed") and always emits additive diagnostics next to the method contract: indirect_p_fixed, branch_mix, p_branch_a, stacked_branch, r4, r4_fixed. indirect_p is unchanged unless ariv = "fixed" (default "own" = legacy Chan–Meng).
  • .medsim_d4_mbco(fixed_branch = ): per-imputation statistics recomputed on the branch the stacked constrained fit selected; numerator d_S shared; returns stacked_branch.
  • Additive columns only — medsim_analyze_*, cluster.R collapse audit, and existing consumers are untouched (branch_switch semantics unchanged).

Why

Standard r4 averages per-imputation MBCO statistics each computed on its own winning branch. When imputations disagree on the branch (Missing Effect pilot: 21–91% of replicates near the null), that average is pulled down, the ARIV is under-estimated, and D4 is inflated. Missing Effect ms:check 2026-08-16 (Fable KO #2) + code/pilot-comparators-2026-08-16.R: own-branch r4 < fixed-branch r4 in every cell; interior-null D4 .062–.096 vs .020–.070 fixed.

Tests (run in this worktree)

devtools::test()1137 passed / 0 failed / 1 skipped (baseline dev: same skip). 4 new tests in test-methods-missing.R: contract + diagnostics present; ariv="fixed" routes indirect_p_fixed into indirect_p with identical point estimate; r4_fixed >= r4 with shared numerator; K=1 (complete data) → both p-values coincide, branch_mix = 0.

E2E (live, devtools::load_all(), interior null a=.39 b=0, n=120, 25% MAR on M and Y, m=20)

seed 1: branch_mix=1 p_branch_a=0.10 stacked=0 r4=0.278 r4_fixed=0.884 p_own=0.083 p_fixed=0.156
seed 2: branch_mix=0 p_branch_a=0.00 stacked=0 r4=0.843 r4_fixed=0.843 p_own=0.524 p_fixed=0.524

Mixing case: own-branch r4 under-estimates (0.278 vs 0.884) and p moves from .083 to .156; no-mixing case: identical, as required.

Follow-up

Release as 0.5.1 so Missing Effect can bump its config.R guard and run the queued fixed-branch Hopper re-run (.STATUS QUEUED-2026-08-17).

🤖 Generated with Claude Code

Test User and others added 2 commits August 17, 2026 00:14
- medsim_method_mbco_mi(ariv = c('own','fixed')): always emits indirect_p_fixed,
  branch_mix, p_branch_a, stacked_branch, r4, r4_fixed (additive to the contract;
  indirect_p unchanged unless ariv='fixed')
- .medsim_d4_mbco(fixed_branch=): d_k recomputed on the stacked fit's branch;
  returns stacked_branch; numerator d_S shared
- tests: 4 new (contract+diagnostics, routing, r4_fixed >= r4, K=1 coincidence);
  full suite 1137 pass / 0 fail / 1 skip
- NEWS: dev-version entry

Motivation: Missing Effect ms:check 2026-08-16 (Fable KO #2) + comparator pilot:
own-branch r4 < fixed-branch r4 in every cell -> interior-null D4 liberal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ARIV

.medsim_d4_mbco() gains an lls_S passthrough; medsim_method_mbco_mi()
computes the stacked log-likelihood triple once and passes it to both
the own-branch and fixed-branch calls (was refit twice per replication).
No numeric change. Addresses /code-review 44 finding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Data-Wise
Data-Wise merged commit c748d1b into dev Aug 17, 2026
Data-Wise pushed a commit that referenced this pull request Aug 17, 2026
…note

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Data-Wise Data-Wise mentioned this pull request Aug 17, 2026
@Data-Wise
Data-Wise deleted the feature/mbco-fixed-branch-ariv branch August 17, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant