481: Add TGI covariate models - #489
danielinteractive wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces new Bayesian Stan statistical models whose correctness rests on parameter-recovery tests gated behind a full-test flag plus semantic changes to shared generated-quantities threading, which warrant human statistical review.
Pull request overview
This PR implements the covariate formulation of the four TGI longitudinal models (LongitudinalRandomSlopeCov, LongitudinalSteinFojoCov, LongitudinalGSFCov, LongitudinalClaretBrunoCov), closing #481. Instead of one set of parameters per treatment arm/study, model parameters are now driven by subject-level baseline covariates through design-matrix predictors (linear / proportional / exponential / log-linear). The diffs shown here are the documentation and test portions of that work: statistical specification math, a quickstart example, custom-model extension guidance with runnable Stan snippets, and supporting test/tolerance updates.
Changes:
- Document the covariate versions of the random-slope, Stein-Fojo, GSF, and Claret-Bruno models in the statistical specification, and add a covariate walkthrough to the quickstart and extending vignettes (with new
custom-cov-model*.stansnippets). - Add parameter-recovery / behavior tests for the new simulation classes and adjust two existing test expectations (
test-SurvivalExponential.Rupper bound,test-simulate.Revent-rate tolerance). - Clean up stale "work-in-progress" banners and a phi-related population-quantities note.
File summaries
| File | Description |
|---|---|
| vignettes/statistical-specification.qmd | Adds "Covariate Version" sections and predictor math; corrects exp/logit notation and phi cleanup |
| vignettes/quickstart.qmd | Adds a runnable covariate longitudinal-model example and covariate overview |
| vignettes/extending-jmpost.qmd | Documents covariate-aware custom-model interfaces and links to the new custom-cov vignette |
| vignettes/custom-cov-model.stan | New illustrative model with baseline/growth covariate design matrices |
| vignettes/custom-cov-model-gq.stan | New lm_predict_value wrapper for the custom model |
| vignettes/custom-cov-model-gq-population.stan | New population generated-quantities using gq design matrices |
| vignettes/custom-cov-model-gq-individual.stan | New per-subject generated-quantities matrix |
| vignettes/custom-cov-model-enable-link.stan | New link-input matrix for the custom model |
| vignettes/custom-cov-model-dsld.stan | New dSLD link contribution (derivative verified correct) |
| tests/testthat/test-SurvivalExponential.R | Updates regex to expect the new upper=8000 lambda bound |
| tests/testthat/test-simulate.R | Loosens the lambda_censor event-rate expectation |
| tests/testthat/test-SimLongitudinalRandomSlopeCov.R | New tests for the covariate random-slope simulator |
Review details
- Files reviewed: 106/107 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage SummaryDiff against mainResults for commit: a941ab8 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 255 suites 11m 46s ⏱️ Results for commit a941ab8. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit c8622ce ♻️ This comment has been updated with latest results. |
closes #481