R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # Preliminaries > setwd("C:/Users/James/Documents/pharmacometrics/testing") > system2(ls()) Warning message: running command '""' had status 127 > system2(dir()) Warning message: running command '""' had status 127 > shell(dir()) > # Folder is empty. > library(nlmixr) Loading required package: nlme Loading required package: RxODE > str(theo_sd) # like Theoph but with ID instead of Subject, also other NONMEM-like 'data.frame': 144 obs. of 7 variables: $ ID : int 1 1 1 1 1 1 1 1 1 1 ... $ TIME: num 0 0 0.25 0.57 1.12 2.02 3.82 5.1 7.03 9.05 ... $ DV : num 0 0.74 2.84 6.57 10.5 9.66 8.58 8.36 7.47 6.89 ... $ AMT : num 4.02 0 0 0 0 0 0 0 0 0 ... $ EVID: int 101 0 0 0 0 0 0 0 0 0 ... $ CMT : int 1 2 2 2 2 2 2 2 2 2 ... $ WT : num 79.6 79.6 79.6 79.6 79.6 79.6 79.6 79.6 79.6 79.6 ... > # 'uif' for Unified Interface Function, 1 compartment, lin for linCmt() > uif.1cm.lin <- function() { + ini({ + logtcl <- -3.2 # log typical value Cl (L/hr) + logtka <- 0.5 # log typical value Ka (1/hr) + logtv <- -1 # log typical value V (L) + + # error model + add.err <- 0.1 + + # Initial estimates for IIV variances + # Labels work for single parameters. + eta.cl ~ 2 + eta.ka ~ 1 ## BSV Ka + eta.v ~ 1 + }) + model({ + cl <- exp(logtcl + eta.cl) + ka <- exp(logtka + eta.ka) + v <- exp(logtv + eta.v) + linCmt() ~ add(add.err) + }) + } > # NLME fittings > > fit.nlme.1cm.lin.theo_sd <- nlmixr(uif.1cm.lin, theo_sd, est="nlme") **Iteration 1 LME step: Loglik: -182.2318, nlminb iterations: 1 reStruct parameters: ID1 ID2 ID3 1.0022617 0.2783009 2.0758984 PNLS step: RSS = 63.14922 fixed effects: -3.211937 0.4479979 -0.7859318 iterations: 7 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.272375 3.267309 **Iteration 2 LME step: Loglik: -179.291, nlminb iterations: 9 reStruct parameters: ID1 ID2 ID3 0.96385527 0.08333435 1.63552295 PNLS step: RSS = 63.28221 fixed effects: -3.211535 0.4441505 -0.7863391 iterations: 7 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.008662381 0.172135330 **Iteration 3 LME step: Loglik: -179.3381, nlminb iterations: 8 reStruct parameters: ID1 ID2 ID3 0.96129928 0.07085834 1.63885629 PNLS step: RSS = 63.2196 fixed effects: -3.211732 0.4458486 -0.7861743 iterations: 7 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.003808629 0.082919683 **Iteration 4 LME step: Loglik: -179.3201, nlminb iterations: 7 reStruct parameters: ID1 ID2 ID3 0.96243507 0.07618717 1.63736945 PNLS step: RSS = 63.22991 fixed effects: -3.211823 0.4451494 -0.7862432 iterations: 7 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.001570583 0.013884126 **Iteration 5 LME step: Loglik: -179.3277, nlminb iterations: 4 reStruct parameters: ID1 ID2 ID3 0.96197111 0.07396744 1.63796900 PNLS step: RSS = 63.24112 fixed effects: -3.211722 0.4454457 -0.7862145 iterations: 6 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.0006651255 0.0147544693 **Iteration 6 LME step: Loglik: -179.3246, nlminb iterations: 1 reStruct parameters: ID1 ID2 ID3 0.96215433 0.07487426 1.63772430 PNLS step: RSS = 63.24112 fixed effects: -3.211722 0.4454457 -0.7862145 iterations: 1 Convergence crit. (must all become <= tolerance = 1e-05): fixed reStruct 0.000000e+00 3.910435e-10 Using sympy via SnakeCharmR C:/RTools/3.4/mingw_64/bin/gcc -I"C:/R/R-34~1.3/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c rx_920cdb7f8c8c7b5e42b1a8db66863398_x64.c -o rx_920cdb7f8c8c7b5e42b1a8db66863398_x64.o C:/RTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o rx_920cdb7f8c8c7b5e42b1a8db66863398_x64.dll tmp.def rx_920cdb7f8c8c7b5e42b1a8db66863398_x64.o -LC:/R/R-34~1.3/bin/x64 -lRblas -LC:/R/R-34~1.3/bin/x64 -lRlapack -lgfortran -lm -lquadmath -LC:/R/R-34~1.3/bin/x64 -lR The model has been setup to calculate residuals. It will be cached for future runs. Diagonal form: sqrt [,1] [1,] 1 Calculate symbolic inverse...done Calculate symbolic determinant of inverse...done Calculate d(Omega)/d(Est) and d(Omega^-1)/d(Est)... .0 ...done. Calculating Table Variables... done Warning message: In nlmixrUI.nlme.var(obj) : Initial condition for additive error ignored with nlme nlmixr UI combined dataset and properties $ par.hist : Parameter history (if available) $ par.hist.stacked : Parameter history in stacked form for easy plotting (if available) $ par.fixed : Fixed Effect Parameter Table $ eta : Individual Parameter Estimates $ seed : Seed (if applicable) $ model.name : Model name (from R function) $ data.name : Name of R data input > # Object x now appears: > ls() [1] "fit.nlme.1cm.lin.theo_sd" "uif.1cm.lin" "x" > # Now exit session and repeat above steps. > # This output will be stored as 'first_output.txt'.