You inherit a half-finished pure-R joint Item Response Theory + Nonlinear Mixed Effects model for longitudinal patient-reported outcomes (14 ordinal items over 11 time points, three latent factors). The shipped entry is deliberately weak: item parameters frozen at a baseline GRM, an exponential trajectory, and no covariates — none of which the engine requires. Your job is to make the model generalize, minimizing the held-out OFV (= −2·logL, lower is better). You submit an algorithm; the sealed verifier re-runs it on a hidden, disjoint set of subjects you never see and independently recomputes the OFV from your emitted parameters, so overfitting the visible subjects or faking a number is useless.
Hard Constraints
- R 4.3 compatible only. No internet at run time (all packages are preinstalled).
mirt/mirtCATare banned, and no Python bridges (reticulate,system("python"),system2("python")). Any banned import scores the submission invalid (reward 0).- Model within the provided engine. The verifier recomputes your OFV from the params you
emit using its own sealed copy of
engine.R, so your model must be expressible as per-factor {item GRM paramsa,b} + one supported trajectory (linear/exp/biexp/triexp) + the SEX/ECOG covariates. - Cover the 14-item instrument exactly once. You may regroup items across factors, but every item must be modeled exactly once (no dropping hard items, no double-counting easy ones).
- Keep the solver CLI contract (see What You Submit).
What You Have
Under environment/ (baked into the agent container at /app):
data/data_AI_visible.csv— visible subjects (with truth) for free local development. Long format columns:ID,TIME,VARIABLE_num,ITEM_NAME,SCORE(0-3),ECOG,SEX. TIME = 0, 30, …, 300 (11 points). Three latent factors: PhysDys (Pain×3 + Dyspnea×2), GI (Appetite, Nausea×2, Vomit, Diarrhea, Constipation), Psych (Activity, Depression, Insomnia_Severity).methods/main/engine.R— the pure-R joint-MLE engine (Samejima GRM + 2D Gauss-Hermite quadrature + L-BFGS-B). Trajectorieslinear/exp/biexp/triexp; helpersfit_joint(),fit_baseline_grm(),pack_*(), andemit_factor_params().methods/main/solver.R— your submission entry (currently the V1 baseline).selfcheck.R— local OFV on the visible set; runRscript selfcheck.Rfrom/appfreely before submitting.
Covariates the verifier builds deterministically (use the SAME recipe):
SEX_M = (SEX=="Male"), ECOG3 = min(ECOG,2), ECOG_1 = (ECOG3==1), ECOG_2 = (ECOG3==2);
time is scaled tau = TIME/300.
What You Submit
Edit methods/main/solver.R, keeping the CLI contract:
Rscript solver.R --data <held-out csv> --out <dir> # writes <dir>/results.json
results.json MUST contain a params object — one entry per factor — that decodes your fitted
model. The easiest way is to call emit_factor_params(traj, items, fit) from the engine on each
factor's fit (see the baseline solver.R). Each factor record holds: traj
("linear"/"exp"/"biexp"/"triexp"), items (order matching a), a (J), b (J×3), the
trajectory scalars (mu, sigma, rho, k/k_slow/k_mid/k_fast, C/C1/C2), and
beta0, beta_slope (length-3 covariate effects on baseline / steady-state-or-slope; zeros for
unused). total_OFV / per_factor_OFV may also be written but are advisory only — the
verifier ignores them. You may add helper .R files under methods/main/ and source() them.
How It Is Judged
The sealed verifier copies your submission into a clean sandbox, runs solver.R on the hidden
held-out subjects, and then re-derives the OFV independently from your emitted params: it
rebuilds the latent trajectories + Samejima GRM likelihood with its own sealed engine.R at a
fixed quadrature and sums the per-factor OFV. It never trusts a self-reported number — a faked
low OFV, or params that do not actually fit, both yield a (correctly) bad score.
- Metric = held-out total OFV, lower is better. A stronger fit to the hidden subjects scores higher; the shipped starter is a deliberately weak floor.
- Invalid (scores 0): banned import; missing
params; the 14 items not covered exactly once; a non-finite or degenerate recomputed OFV (below the disclosed 8000 sanity floor).