I have a parameter kon that I know decreases with time - it would be easy to say:
k_on = t -> t*θ[1].
The problem is that every-time I dose my drug again the parameter should go back to it’s original value is there a way to accomplish this? Maybe via callback?
Sounds great. Thank you!
Have a great break -
An example use for this is let’s say I have an antibody based drug in the blood-stream. Sometimes aminoacids get oxidized which result in decrease of antibody binding to target k_on, as the antibody spends more time in the blood it’s k_on lowers more, but when we add a new dose of antibody. The k_on should reset to the original value if all the antibody has been cleared or to a weighted average of the two populations remaining antibody + newly injected, ie:
k_on = k_on_start # not prior AB remaining
k_on = (Cremaing*k_on_remaing + Cnewdose*k_on_start)/(Cremaing + Cnewdose)
I have done some modeling like this using the differential equations suite and callbacks, but I am not a programmer by training and I am not sure how to code populations. I work one patient at a time for sims and fits before Pumas. I'll be happy to share an example of my code by e-mail if you are interested, it's messy, specially when compared to your very nice API, but it does work well
Take care and happy holidays again :)
Using a DiscreteCallback won’t work right now since the dosing callback will override it, but that can be handled by setting a CallbackSet over an existing callback, grabbing it from either the prototype problem or from the kwargs of simobs et. al. Could you open an issue and just periodically remind me?
That’s aweosme. I noticed that you used solve instead of simobs command to generate your Pumas solution. Is there a reason for that are you directly calling DifferentialEquations.jl solver?
If I were to perform a fit with a Discrete callback would the Pumas fit still be indicated, or would I need to use DiffEqParamEstimator?
That’s just because I was debugging and the continuous solution of a solve just makes it easier to identify all discontinuities are correctly handled. The same will work from simobs. These callbacks will directly work with Pumas’ NLME estimation functionality as well, though if you use a continuous callback there’s a detail I plan to handle next week