I have a question about improving efficiency of estimation (or really the ODE simulation) with a covariate that discontinuously flips from 0 to 1 in time.
Here is the backdrop. I’m simulating a rollover study where people that were initially in Placebo condition are switched to taking the drug after an initial time period. Due to the nature of the data I only know that they switched from placebo to drug. As such, I effectively have a covariate that switches discontinuously in time (placebo = 0, drug = 1 with a switch at some time).
In this context, I am fitting a population model with IIV on some parameters with a simple ODE model at the individual level. Standard popPD sort of thing. Some of the parameters that have IIV on them are associated with this discontinuous covariate.
I am finding that when I try to estimate this model, the estimation is very slow relative to what’s expected (order of magnitude slow). This is almost certainly due to the discontinuity in the covariate and its impact on the ODE solver. The ODE model itself is quiet simple and not at all stiff. The data itself is also fairly regular. Further, the number of estimation steps is reasonable. So I’m pretty sure it is the covariate discontinuity.
Any suggestions to address this? I’ve used the SciML toolkit outside of Pumas in the past and am fairly familiar. I assume you all have plugged in some stiff solvers. However I know that Pumas is making some choices in the backend that I don’t know about. Any suggestions on how to handle this sort of issue? Is it as simple as specifying a particular solver, and if so is there one recommended for this case where stiffness is local in time?