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

Rounding error in output time #1241

Open
Andy00000000000 opened this issue Sep 25, 2024 · 1 comment
Open

Rounding error in output time #1241

Andy00000000000 opened this issue Sep 25, 2024 · 1 comment

Comments

@Andy00000000000
Copy link

Hi,

Unfortunately, I cannot provide a full reproducible example. In a simulation of 10 subjects with identical dosing times, I noticed that a summary of mean concentrations vs. time was jaggedly jumping up and back down at certain times. It ended up that at the specific erroneous times, two summary records were being created (for one such input time = 2184 (attached); N = 9 was as expected, while N = 1 appeared to have a rounding error). This error was only occurring at observational outputs at times of dose, but not at all of the dose times (attached is a list of dose times with the error times marked). My workaround currently is to round mrgsolve time output to same digits as supplied input times.

Running mrgsolve version 1.4.1 on R 4.4.1 on Ubuntu 24.04 LTS. Have not yet tested whether error occurs with newest CRAN release of mrgsolve.

Best,
Andy

image
image

Simulation calls/options:

out<- mod2 %>%
  data_set(evD) %>%
  idata_set(demo) %>%
  param(x = x)%>%
  carry.out(evid,x) %>%
  mrgsim(recsort=3, tgrid = sort(unique( c( seq(0,(ndose*lcycle),1), seq(0,simendtime,4) ))), atol=1E-25, Req = "x")
as.data.frame(out)
@kylebaron
Copy link
Collaborator

Thanks for the report, @Andy00000000000 . This looks like some issue with representing the number. I'm not sure where number 9 turned different.

If you can, please keep working on a reproducible example that we could run. That would help us start in on this.

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