Description
It would be a nice feature to add - if there is capacity - to allow the user to specify whether the last observation is carried forward (locf) or if the next observation is carried backwards (nocb) for models with time-varying covariates. This has partly been discussed in https://discourse.mc-stan.org/t/time-varying-covariate-implementation/38809/11.
Example
I think a similar feature has been added to nlmxr2: https://blog.nlmixr2.org/blog/2024-09-18-nlmixr2-3.0.0-release/
Now you can specify the interpolation method per covariate in the model:
- linear(var1, var2) says both var1 and var2 would use linear interpolation when they are a time-varying covariate. You could also use linear(var1)
- locf() declares variables using last observation carried forward
- nocb() declares variables using next observation carried backward
- midpoint() declares variables using midpoint interpolation
Ideally, this option would be directly added to the functions such as pmx_solve_twocpt():
pmx_solve_twocpt(... , ipol)
Expected Output
pmx_solve_twocpt(... , ipol)
Current Version:
v0.91.0