Skip to content

Simulate patients from fitted model#449

Open
gravesti wants to merge 16 commits intomainfrom
sim_results
Open

Simulate patients from fitted model#449
gravesti wants to merge 16 commits intomainfrom
sim_results

Conversation

@gravesti
Copy link
Copy Markdown
Collaborator

@gravesti gravesti commented Feb 11, 2026

  • Implements new patient data simulation from a fitted model.
  • Adds vignette describing new functionality
  • Adds utility functions add_pfs() and cut_data() for detecting tumor progression and clinical cut off
  • Adds example data set from clinical trial

@gravesti gravesti marked this pull request as ready for review April 10, 2026 12:45
@gravesti gravesti requested a review from mercifr1 April 10, 2026 12:45
@github-actions
Copy link
Copy Markdown
Contributor

badge

Code Coverage Summary

Filename                           Stmts    Miss  Cover    Missing
-------------------------------  -------  ------  -------  ---------------------------
R/brier_score.R                      167       0  100.00%
R/DataJoint.R                         76       0  100.00%
R/DataLongitudinal.R                 119       1  99.16%   244
R/DataSubject.R                       85       1  98.82%   142
R/DataSurvival.R                      98       0  100.00%
R/defaults.R                          10       6  40.00%   18-57, 84
R/generics.R                          36       5  86.11%   52, 382, 402, 464, 481
R/Grid.R                              27       1  96.30%   173
R/GridEven.R                          32       0  100.00%
R/GridEvent.R                         22       0  100.00%
R/GridFixed.R                         30       0  100.00%
R/GridGrouped.R                       52       0  100.00%
R/GridManual.R                        23       3  86.96%   78-80
R/GridObserved.R                      20       0  100.00%
R/GridPopulation.R                    31       4  87.10%   61, 69-71
R/GridPrediction.R                    36       6  83.33%   83, 91-95
R/JointModel.R                       131       9  93.13%   146-151, 201, 205, 247, 322
R/JointModelSamples.R                 71       0  100.00%
R/link_generics.R                     16       4  75.00%   59, 76, 91, 106
R/Link.R                              62       4  93.55%   200-203
R/LinkComponent.R                     19       3  84.21%   88, 120-121
R/LongitudinalClaretBruno.R           90       6  93.33%   168-172, 187
R/LongitudinalGSF.R                  101       0  100.00%
R/LongitudinalModel.R                 19       0  100.00%
R/LongitudinalQuantities.R            71       0  100.00%
R/LongitudinalRandomEffects.R         53      17  67.92%   80-105
R/LongitudinalRandomSlope.R           45       6  86.67%   102-106, 119
R/LongitudinalSteinFojo.R             91      10  89.01%   159-163, 194-198
R/Parameter.R                         14       0  100.00%
R/ParameterList.R                     42       1  97.62%   184
R/populationHR.R                      44       0  100.00%
R/Prior.R                            270       6  97.78%   547, 691-705
R/Promise.R                           25       0  100.00%
R/Quantities.R                        60       0  100.00%
R/QuantityGeneratorPopulation.R       22       0  100.00%
R/QuantityGeneratorPrediction.R       48       0  100.00%
R/QuantityGeneratorSubject.R          19       0  100.00%
R/settings.R                          12      12  0.00%    55-69
R/SimGroup.R                           5       0  100.00%
R/SimJointData.R                     126       6  95.24%   103, 232-236
R/SimLongitudinal.R                    5       2  60.00%   22, 40
R/SimLongitudinalClaretBruno.R        74       0  100.00%
R/SimLongitudinalGSF.R                80       0  100.00%
R/SimLongitudinalRandomSlope.R        42       0  100.00%
R/SimLongitudinalSteinFojo.R          69       0  100.00%
R/SimSurvival.R                      117       0  100.00%
R/simulate.R                         284     284  0.00%    36-451
R/StanModel.R                         15       0  100.00%
R/StanModule.R                       176       6  96.59%   192-193, 235, 246, 383, 411
R/SurvivalExponential.R               10       0  100.00%
R/SurvivalGamma.R                     13       0  100.00%
R/SurvivalLoglogistic.R               11       0  100.00%
R/SurvivalModel.R                     19       0  100.00%
R/SurvivalQuantities.R               170       1  99.41%   125
R/SurvivalWeibullPH.R                 13       0  100.00%
R/utilities.R                        144       2  98.61%   13, 335
R/zzz.R                               29      26  10.34%   4-8, 10-31, 38-47
TOTAL                               3591     432  87.97%

Diff against main

Filename            Stmts    Miss  Cover
----------------  -------  ------  --------
R/DataJoint.R           0      -2  +2.63%
R/JointModel.R         +1      -2  +1.59%
R/SimJointData.R      +54      +5  -3.37%
R/SimSurvival.R        +1       0  +100.00%
R/simulate.R         +284    +284  +100.00%
TOTAL                +340    +285  -7.51%

Results for commit: ef4a898

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Copy Markdown
Contributor

Unit Tests Summary

    1 files    191 suites   7m 4s ⏱️
  169 tests   154 ✅ 15 💤 0 ❌
1 134 runs  1 118 ✅ 16 💤 0 ❌

Results for commit ef4a898.

@github-actions
Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
LongitudinalRandomEffects 💚 $88.72$ $-32.61$ $0$ $0$ $0$ $0$
extract_quantities 💚 $7.96$ $-7.94$ $0$ $0$ $0$ $0$
misc_models 💚 $14.41$ $-5.33$ $0$ $0$ $0$ $0$
model_multi_chain 💚 $56.40$ $-49.18$ $0$ $0$ $0$ $0$
simulate 👶 $+0.03$ $+1$ $+1$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
Grid 💚 $112.48$ $-70.97$ Grid_objects_work_with_QuantityGenerator_and_QuantityCollapser
GridPrediction 💚 $131.20$ $-14.04$ GridPrediction_works_as_expected_for_Survival_models
JointModelSamples 💔 $11.82$ $+21.06$ print_works_as_expected_for_JointModelSamples
LongitudinalClaretBruno 💚 $1931.51$ $-1924.87$ LongitudinalClaretBruno_works_as_expected_with_default_arguments
LongitudinalGSF 💚 $1772.47$ $-1764.56$ LongitudinalGSF_works_as_expected_with_default_arguments
LongitudinalQuantiles 💚 $51.04$ $-41.06$ Test_that_LongitudinalQuantities_works_as_expected
LongitudinalRandomEffects 💚 $88.72$ $-32.61$ LongitudinalRandomEffects_works_as_expected
LongitudinalRandomSlope 💚 $59.22$ $-55.61$ Print_method_for_LongitudinalRandomSlope_works_as_expected
LongitudinalSteinFojo 💚 $1709.34$ $-1707.16$ LongitudinalSteinFojo_works_as_expected_with_default_arguments
SimJointData 👶 $+0.01$ add_pfs_works_as_expected
SimJointData 👶 $+0.00$ add_pfs_works_with_large_from_time
SimJointData 👶 $+0.00$ cut_data_works_as_expected
SimSurvival 💚 $3.05$ $-2.84$ SimSurvivalExponential_creates_a_dataset_with_the_correct_parameter
SurvivalExponential 💚 $36.39$ $-35.18$ Can_load_and_compile_SurvivalExponential_model
SurvivalGamma 💚 $210.84$ $-210.59$ Print_method_for_SurvivalGamma_works_as_expected
SurvivalLoglogistic 💚 $44.18$ $-42.88$ Can_load_and_compile_SurvivalLogLogistic_model
SurvivalQuantities 💚 $93.75$ $-37.23$ SurvivalQuantities_and_autoplot.SurvivalQuantities_works_as_expected
SurvivalWeibullPH 💚 $15.61$ $-14.16$ Print_method_for_SurvivalWeibullPH_works_as_expected
brierScore 💚 $69.96$ $-63.89$ brierScore_SurvivalQuantities_returns_same_results_as_survreg
brms_compare 💚 $342.24$ $-342.18$ jmpost_and_brms_get_similar_loo_for_longitudinal_models
extract_quantities 💚 $7.96$ $-7.94$ extract_quantities_works_as_expected
initialValues 💚 $2.78$ $-1.00$ initialValues_works_as_expected
misc_models 💚 $14.41$ $-5.33$ Longitudinal_Model_doesn_t_print_sampler_rejection_messages
model_multi_chain 💚 $56.40$ $-49.18$ Can_recover_known_distribution_parameters_from_random_slope_model_when_using_multiple_chains
populationHR 💚 $30.64$ $-10.04$ populationHR_works_as_expected_for_default_parameters
simulate 👶 $+0.11$ simulate_works_with_default_options
simulate 👶 $+0.02$ simulate_works_with_jitter_and_times
simulate 👶 $+0.03$ simulate_works_with_lambda_censor
stan_functions 💚 $37.00$ $-20.65$ GSF_SLD_function_works_as_expected

Results for commit c283172

♻️ This comment has been updated with latest results.

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.

2 participants