Why the model has a health component, PC-excluded scores and frailty (ablation)¶

Not a manuscript figure. This is the ablation that chose the model's recipe (Methods: Health component, Frailty, Polygenic scores and analysis cohort). Fits are batch 0 (10,000 people), 20 signatures plus the health component, and without the polygenic age slope; the manuscript backbone (src/train_slope_3way.py) adds the slope. Each panel is a population mean over one ancestry group (smallest group: tens of people).

Rows: health component on/off, then PC-exclusion / shift of the health curve / frailty. Without a health component (top three rows), weight that should mean "well" lands on quiet disease signatures by sex (S18 female, S13 male); with it but without PC-exclusion, non-European groups land on one low-hazard signature (S12). Only all three together (bottom row, outlined) keep every group on the health component.

Runs locally against the authors' results (CODE). With RUN = False the cells show the current local figures; set RUN = True to regenerate each panel from the script named. No participant data are stored in this notebook; keep outputs cleared before committing (python ../tools/check_no_ids.py).

Panel Where each ancestry group's signature weights go, for every combination of the three changes¶

Script: src/fig_factorial_stacks_by_ancestry.py

Environment: PUBLIC=1

Upstream: reads the batch-0 checkpoints of the ablation fits (2x2x2 over PC-exclusion / shift / frailty, plus three arms with no health component); ancestry (1000 Genomes projection) is used for evaluation only

Script header (inputs, recipe, outputs)
fig_factorial_stacks_by_ancestry.py -- where each ancestry group's theta goes over the lifespan,
for ALL EIGHT combinations of the three interventions.

WHY. The 2x2x2 table says which arm works. This says WHAT GOES WRONG in the ones that do not, and
it is the same picture every time: the healthy row is unreachable, so the mass lands in whichever
quiet row that person can reach -- S12 for non-Europeans, S18/S13 by sex.

The 21 signatures are collapsed to the four slots the whole investigation is about, plus the rest:
  healthy (green)  the row we added -- where "well" is supposed to live
  S12     (cyan)   the ancestry sink: lowest hazard of any row (0.064/yr), weakest identity (psi rank 20/20)
  S18     (pink)   the female reservoir
  S13     (blue)   the male counterpart
  other 17 (grey)  actual disease composition

inputs : claudefile/results_{hr20_40,shift15_only,frailty_hr2,frailty_lift,exclpc_a06,
         exclpc_shift15,frailty_exclpc_nolift,frailty_lift_exclpc}/ batch-0 checkpoints
         data_for_running/*, aladynoulli2/ukb.kgp_projected.tsv (ancestry, EVALUATION ONLY)
recipe : rebuild lambda with the geometry each arm was TRAINED on (G 47 vs 37 cols, curve
         alpha/shift), theta = softmax_k over 21 rows, population mean per group per age.
outputs: fig_factorial_stacks_by_ancestry.png; with PUBLIC=1: fig_factorial_stacks_by_ancestry_public.png (no group sizes
         in the titles, as in Fig 6 v2) + .prov.json via provenance.save_prov
run    : [PUBLIC=1] /opt/miniconda3/envs/new_env_pyro2/bin/python claudefile/fig_factorial_stacks_by_ancestry.py
NOTE   : these are the batch-0 ABLATION fits (21 rows: 20 signatures + healthy; no gamma slope) that chose the recipe; the
         paper's backbone is the triplet WITH the gamma slope (train_slope_3way.py). Group means only (smallest group >= 43).
NOT a concentration plot: an even stack is compatible with everyone being one-hot, provided
different people are one-hot on different signatures.
PHI: ancestry joined on eid internally; every plotted value is a group mean over >=43 people.
No description has been provided for this image