Class to house the latent random variables that govern toxicity and efficacy events in patients. Instances of this class can be used in simulation-like tasks to effectively use the same simulated individuals in different designs, thus supporting reduced Monte Carlo error and more efficient comparison.
Sweeting, M., Slade, D., Jackson, D., & Brock, K. (2024). Potential outcome simulation for efficient head-to-head comparison of adaptive dose-finding designs. arXiv preprint arXiv:2402.15460
num_patients
(`integer(1)`)
tox_u
(`numeric(num_patients)`)
time_to_tox_func
(`function`)
tox_time
(`numeric(num_patients)`)
eff_u
(`numeric(num_patients)`)
time_to_eff_func
(`function`)
eff_time
(`numeric(num_patients)`)
can_grow
(`logical(1)`)
new()
Creator.
PatientSample$new(
num_patients = 0,
time_to_tox_func = function() runif(n = 1),
time_to_eff_func = function() runif(n = 1)
)
num_patients
(`integer(1)`) Number of patients.
time_to_tox_func
(`function`) function taking no args that returns a single time of toxicity, given that toxicity occurs.
time_to_eff_func
(`function`) function taking no args that returns a single time of efficacy, given that efficacy occurs.
set_eff_and_tox()
Set the toxicity and efficacy latent variables that govern occurrence of
toxicity and efficacy events. By default, instances of this class
automatically grow these latent variables to accommodate arbitrarily high
sample sizes. However, when you set these latent variables manually via
this function, you override the ability of the class to self-manage, so
its ability to grow is turned off by setting the internal variable
self$can_grow <- FALSE
.