nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
115 stars 45 forks source link

Add output descriptions #439

Open mattfidler opened 3 years ago

mattfidler commented 3 years ago

http://monolix.lixoft.com/tasks/result-files-generated-monolix/

namtien0312 commented 3 years ago

Hi, thanks for the useful package. I am learning your package for my modeling project and I have a problem when printing output. You can see my output is missing a lot of information as compared with tutorials. image

mattfidler commented 3 years ago

Can you provide a reproducible example and I can help you with what is happening.

Based on the output it seems you attempted a SAEM model and the creation of the final output had an error. The classic saem output is returned instead.

namtien0312 commented 3 years ago

Sorry for my negligence. Here is my code.

one.comp = function() { ini({ tka = 0.45 # logka tcl = log(c(0, 2.7, 100)) # logcl tvc = 3.45 # logvc eta.ka ~ 0.6 eta.cl ~ 0.3 eta.vc ~ 0.1 add.err = 0.7 }) model({ ka = exp(tka + eta.ka) cl = exp(tcl + eta.cl) vc = exp(tvc + eta.vc) d/dt(depot) = -ka * depot #depot, central are amount of drug in that comp d/dt(central) = ka * depot - cl/vc * central cp = central/vc # conc = amount/volume cp ~ add(add.err) }) }

fit.saem = nlmixr(one.comp, pk.data, est = "saem"); print(fit.saem)

And my output is: THETA: th log(th) se(log_th) [1,] 2.7214126 1.001151 0.06811979 [2,] 0.1198806 -2.121259 0.04300321 [3,] 3.2158717 1.168098 0.03168522

OMEGA: [,1] [,2] [,3] [1,] 0.1132898 0.00000000 0.00000000 [2,] 0.0000000 0.06730753 0.00000000 [3,] 0.0000000 0.00000000 0.02952437

ARES & BRES: [,1] [1,] 4613.839

I then make an effort by using nlme estimation, but the error came with me, as you can see:

fit.nlme = nlmixr(one.comp, pk.data, est = "nlme") Out: Error in nlme.formula(model = DV ~ (nlmixr::nlmeModList("user_fn"))(tka, : step halving factor reduced below minimum in PNLS step

I'm wondering whether the cause for this is my error installation of nlmixr package? Thank you very much for helping.

mattfidler commented 3 years ago

You need to update RxODE and nlmixr; These were bugs I observed as well; They have been fixed.

As far as the step halving factor reduced below minimum in PNLS step you have to adjust the pnlsTol higher to get the nlme estimation to complete.

namtien0312 commented 3 years ago

I updated using devtools::update_packages(nlmixr) and RxODE but the results also as you see before.

Whether am I using the wrong update syntax or are there any other errors?

Thank you!!

mattfidler commented 3 years ago

I have never use the update function; Here is what I use:

devtools::install_github("nlmixrdevelopment/RxODE")
devtools::install_github("nlmixrdevelopment/nlmixr", force=TRUE) # if needed force install
mattfidler commented 3 years ago

Another error I see the dlls are not updated correctly (especially on windows). Sometimes you need to restart R or even reboot.