metrumresearchgroup / Torsten

library of C++ functions that support applications of Stan in Pharmacometrics
BSD 3-Clause "New" or "Revised" License
52 stars 11 forks source link

error in fitting one compartment model with oral dose #32

Closed ghost closed 3 years ago

ghost commented 3 years ago

I tried to fit a one compartment population PK model using clinical data but I kept having warning massage. I have tried to run the two compartments population PK examples provided in this github and experienced the problem as following:

// poppk2cpt example

fit variable mean median sd mad q5 q95 rhat ess_bulk ess_tail lp__ 883.90 884.27 7.31 7.34 871.43 895.30 1.01 505 792 CLHat 5.03 5.03 0.04 0.04 4.96 5.10 1.00 1773 1677 QHat 8.41 8.40 0.34 0.33 7.88 9.00 1.01 1387 988 V1Hat 20.76 20.97 1.59 1.35 17.85 22.92 1.01 1245 573 V2Hat 72.27 72.16 2.16 1.92 68.86 75.85 1.00 1518 934 kaHat 1.25 1.27 0.11 0.09 1.07 1.41 1.00 1239 599 sigma 0.10 0.10 0.00 0.00 0.10 0.11 1.00 4544 1472 L[1,1] 1.00 1.00 0.00 0.00 1.00 1.00 NA NA NA L[2,1] -0.04 -0.05 0.39 0.44 -0.65 0.62 1.00 3146 1674 L[3,1] -0.01 -0.02 0.42 0.47 -0.69 0.68 1.00 4244 1832

showing 10 of 6187 rows (change via 'max_rows' argument)

Warning messages: 1: In .subset2(x, "print")(...) : NAs introduced by coercion 2: In .subset2(x, "print")(...) : NAs introduced by coercion

I think this issue generate error massage when plotting some diagnostic plots as following:

Error: Some 'pars' don't match parameter names: CL, Q, V1, V2, ka FALSE Run rlang::last_error() to see where the error occurred.

ggsave(file.path(figDir, "density.pdf")) Saving 13.6 x 5.89 in image p <- mcmc_pairs(fit$draws(), pars = c("CL", "Q", "V1", "V2", "ka", "sigma"),

  • off_diag_args = list(size = 1, alpha = 0.5)) Error: Some 'pars' don't match parameter names: CL, Q, V1, V2, ka FALSE Run rlang::last_error() to see where the error occurred. ggsave(file.path(figDir, "pair.pdf"), p, width = 10, height = 8) Error in grid.draw(plot) : object 'p' not found

I am using Mac Pro macOS Mojave V. 10.14.6 (18G6032).

Your help appreciated.