Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with timing of change of time-varying variable (not related to nocb=T option) #1036

Open
ssancheGH opened this issue Dec 15, 2022 · 1 comment

Comments

@ssancheGH
Copy link

Hi,

I noticed an issue with the package (version 1.0.6). This concerns time-varying parameters/covariates (not related to the nocb option).

In dset (see attached image), ETA_F1_IOV is an interoccasion variability transformed into F_DEPOT for each dosing occasion using the .cpp equations. You can see from dset that the bioavailability parameter is meant to change at 168.0167 (then at 336.0, 504.0167, etc).
image

I then simulated concentrations using:
sdata.frame <- mod %>%
data_set(dset) %>%
idata_set(iparams) %>%
Req(CP,PPI,PctPPI,KA,F_DEPOT,DOSN) %>%
mrgsim_df(end=2000, nocb=F,delta=0.05)

The issue: I compared simulation outputs between NONMEM and mrgsolve and there was no match. After simulating and outputting the bioavailability values at the different time points, you can notice that F_DEPOT changes from 0.3518 to 0.4151 after 168.0167.
image

So the timing of the ETA_F1_IOV change is slightly off. It may not be an issue for most time-varying variables, but the timing of the change is quite important for bioavailability because I understand the total amount of absorbed drug is determined from the bioavailability at the time of dose administration. I solved the issue by adding 0 doses just before the timing of new doses and changing ETA_F1_IOV at that point (see attached). This resulted in a match between mrgsolve and NONMEM outputs.
image

Do you have enough information to fix the issue? Let me know!
Steven Sanche (PhD)
Associate Director IDD, Certara Inc.

@kylebaron
Copy link
Collaborator

Hi @ssancheGH -

Thanks for reaching out. If you could create a reproducible example for this that I could run with you, I could definitely look into this.

We do have tests for time-varying covariates here
https://github.com/mrgsolve/nmtests/blob/master/time-varying/time-varying-vignette.md

This test looks at time-varying covariates on disposition parameters.

I did open up an issue earlier that looked at how time-varying covariates should affect dosing events (like your example):
#808

At the end of that, I still couldn't tell if there was a problem or not and haven't had time to dig into it. I think if you can give me a minimal example that runs under NONMEM and mrgsolve it could give us a place to dig in and figure it out.

Thanks!
Kyle

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

No branches or pull requests

2 participants