From f6d0530e60bf894bb694572e95573def51180c30 Mon Sep 17 00:00:00 2001 From: mattfidler Date: Wed, 18 Sep 2024 16:27:24 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20nlmixr2/?= =?UTF-8?q?monolix2rx@9a010f7f3ae76e6508920b93a84a473af6494730=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/create-augPred.html | 4 ++-- articles/create-vpc.html | 2 +- articles/mod-PowerPoint.pptx | Bin 855605 -> 855606 bytes articles/mod-Word.docx | Bin 592440 -> 592443 bytes pkgdown.yml | 2 +- search.json | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/articles/create-augPred.html b/articles/create-augPred.html index a546739..3c00e57 100644 --- a/articles/create-augPred.html +++ b/articles/create-augPred.html @@ -154,8 +154,8 @@

Step 2: convert the rx #> #> ── Time (sec fit$time): ── #> -#> setup optimize covariance table compress as.nlmixr2 -#> elapsed 0.03108 4e-06 5e-06 0.055 0.006 2.074 +#> setup optimize covariance table compress as.nlmixr2 +#> elapsed 0.034833 4e-06 6e-06 0.059 0.007 2.204 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> diff --git a/articles/create-vpc.html b/articles/create-vpc.html index aa129fa..5ff3771 100644 --- a/articles/create-vpc.html +++ b/articles/create-vpc.html @@ -152,7 +152,7 @@

Step 2: convert the rx #> ── Time (sec fit$time): ── #> #> setup optimize covariance table compress as.nlmixr2 -#> elapsed 0.034441 4e-06 6e-06 0.057 0.006 2.131 +#> elapsed 0.035589 5e-06 6e-06 0.057 0.006 2.236 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> diff --git a/articles/mod-PowerPoint.pptx b/articles/mod-PowerPoint.pptx index 8a6ec469d0ae8ee48ab06d061ad50f2d497f7637..d4ad5e4808636b14c7704bd284d0c38b0144bd84 100644 GIT binary patch delta 1098 zcmY+De@I<*6u|HId*8k9zI)H{NBTCghdO(#lJJ?hY0VS`VQV59A>6fsF&Fetu@M6u zX!49lg_S=~q2xA&jTKqS_B7batUpGHZPWf)T2PktN9g{DsOIZ@-&g~R!N&N<)n zJ>Ty+_wsnvmGLTQJ!}T@4aaeew)m$|C1hKCwoyDMm7Xv=(%P~o#9nKnr}KENdn#3S zy*ev#_w0Jp!^{5oRipKA&~a{j^!ubaackuZZg*36^A)0!D*7M?a*J&ko>U^Dw@?I_XY%1 z)x?WOlJz&?fef9w1$h~oThWwUT7_3#wS^a@$rC@pw7RCInxElZhVE{_{$1*neg8pT z+WhnmRIA|l4%93C)eh8#+TxXd`VA=4y~r3P?)rpg6Cy^0d1!sJko(h#VW(Vk%hWbQOl@&(K7aD5*Smxl_Te{ ziE9|y#E5Xn5^17lff2K*-J@geUN!w9IRA{mLNl=DQOTMYR;Du1OxY3}#0IrV^vyfn zKv_LdO3M;KU29Epl9fK7tv(1-G{{Nzm{=&@p;{B`14Hy{#c+F+BRNhT{sJ7|?K4!J$D7yKM%4NW)15FAZz>hCy_W z2C+q+86y$IVtOTrG5Pri3X15Og4sz8=rD9$)NoY6YaeU)P{F^m8vapmdS1iyJXq8c z!ZLZ}nzp%8J(}h2tOwDn74sf$e?rW1xU%0%VA9dTs zh=iN8;9>#sq`Ip6>F2KZ*mLlf_VCoY)Z=MSzw*4kqCJZqs%fO#Y&5@I1zKN)U6cbl zv`bXYC;~6 ca!M%m7+ptvNS*yBa@sQTvM_2twF8{!e}ZZ}DgXcg delta 1167 zcmZWoT})J05WeT!y}Qfa8KB|~_xG086~dWX|`^ zH)rOYGxxjh;J4jDs1NC`#hTaa)g~erASmQSWUyB3kjnSyyBu%0d&Kh7&FAmso`_6- zzvZ8{%kNg5JACun2ibdy>O&rH&XJKrF`;RBdQ9Y4gAY7kp-MmIzvyO94ckoX(?+Yc z(GqNuO=ol2jg~P~I4fu^t})o$Y#uf*TN<0sF0L^Hepa>eHg>}{Xj{#|z8{6+*Hv!k zEm%S8Zo=d&u&aNEMd}z%$o_Z?vJ|peSm7*gjKcw+iu0m?>HrOU-+lO6oz$W1wSU5w z^C&(ArP*qO(r1w6(4jb#DRDFoRm%Suhsv~xNJ-ea2l6H0E%7tGlYp0&D)#!NqJPWz zc6!~K7SQIuzLq2Y*lB-0U2ui?J11UU}i-}3bRWw<((p2Fn1nb{soVfHI# z@5vPA7iPqVBs{oPd_?sgtP>;j1tWQ}SIJ(abT1akrgKTKQ-S9GB=|;w{|1xbsR9Rw zlVD&N45~}Rl`=e%WKN}VxZ!dVOfwL-Dc8sMx#KEO(^V)~RUZ;EN1y$zO2TI!u1gH@ z^HuN|EM4%7295f#D4^z~|LuanBMweICo(C+ee{W$e7bfO ziQY;^u9&DsmL{3hN5_HgjYD?&!mcO)JSAmR30UaVkM}G)6_J{j;ng(%f+l^`JS%d` zj594Pg6BlP(hq>OdTbi#!Za+VJmh(6qD{#2_6mKb+$#DBahYoDF>>vf3DU99T^R?i F_CM_tTlxS1 diff --git a/articles/mod-Word.docx b/articles/mod-Word.docx index 354cc07a5a920276db5841a5d794b27767c9bbdf..1f19f658e71bfbca97abdd774e1fa70601c52ee7 100644 GIT binary patch delta 4182 zcmY*cc|6o_*B;B58N2NJz6)8h?;1q*eUj#97ZPPD3?oKJGQ&`^Gm;_3ZbDO8vhPU} zjWpIs8`3k=^FHtMzTfZX{+#<<-|Ig2bv}IuA0f50^fJl9rYY-L z&THq$#%}aUM^FcIh2^Td@Y74kEP89b*Q1Phq7IMWfQO@o4w#+yWm=o;*YZ}|FackJ z><29yXb0ms<5yOlzBdP!Emq9$rAPbuPMb!u0x@O87yhPSCSm7&g*)`GaUvYviG@)b z9>A(&cZ#=s+}zme;F~N*+{fCt60bH2+0I(NqFXEaFk|a$TC(CNsMP-J7jUQhV-G~T zy^q-TXhKKwllDx08wt2p&vKS72NseL*B!C5CDFn1=~%_^lQ}Z3F1p)^Ic&JoQHYR+ z59={Yie2@ zzvCxBnT6f=2+Q?ptJXzM1*njysmWX3 zR^@j}ncy16l;a;?7aQiCqU`gMEkn#5^zUiy9w!}cv>%z}9!?j^U8IB97n36H zr!SMmgjiAvHXOho58$d6%U&7y?`~JUa+^>R0_EjuSsJl?YqjQ2WXr@$9beKX+MP*|7;~q>hGFvHTK~OTnPtL$&r|Vgenxq$SfwW^T z|4@6`^xH#AVnSw5yv@Uy3~VE3b=iXbnes6QRhj`qWns(sMV496xubonS!B58NyShA z1f&<0KM4-IFZWAkWJ6SJSDB4jK0kM%#%yG@)@9nJy#$3DCSjse77?|+Z%uNTM|Esx zT2BXBX4JyMD$Tpc&!Yw0SBM{<*-fiAMC{7-d7k?4^8l_RcuCRX+q!}4AS88(tlL_w z9z3|vWO*v{HGEjxCfW?(?A;V0oqQSBp?Ln}#_~mP%IZ5#=7X?I%Sk_tiJG-K59xWzvM}a_o-Vr7mQup|o+~X+JGo7}Nk)nkE`OS*RnMA6`A-ZDgEXXA!~CbM|pT z+KJeyGTu^+w;|bFuHH|%$q6#|D45j8KmC|eMbkL63Wd+l9Zol@P+m-)TQG0p%&UoY z4B}}nUam5Y_8CF=SiZ*0J!V#$3Ko(N$Wgc&AVWEdj-1$>!AiBNU&F(Be)sypC#FJJ z1to;4zyV>?DTEF#dI0T;+Em%;jDo9U!nCFpNC1k0nThbGpTEA zt%G1YWlzaPR>iW1b3+O|VyW=_MARKm5A&n0bXT0cO+gao?pq2A_#o=OSDlj`Y!9E1 z^ia-_pLs0_tU50H8=X+3)Gjk5D>asvpogV@JdW7URpI>^Z}7yiS7R~5Qt$Nq*Gyu_ zFi}JK&y&}h*-GnDz9VS9Mh#d@GSpCh<_WocS zEyyiqef-Z=5{bMsy1k~>I3Mls-f!U~Fq?w!5Oi5eZb`)K&4zV}EzTIQ!R@8zzG0Ip!d|F)i#f?n_Tn2c5-3e8DG*_#6>(lW2 zpr!-)9YUeCqm05So?XK6yB}VvQp5>luEk*a!#Gxc?~#&nX~bskjX{0?rIqENJ-g%I z;v{xB>Z!r?H-bi>-?WR_onl#kV6-jX1y9=9@_Tq|4Qub&vrKVNPzMHaR^!_%psBwS zm$+WGs2%Behs`Ih+GnLPo{slpQYiN7yLz=*{K~Ggv~v+ z)|C-KoMMNdZd;HfS8^k*b+bM0)6|GI?^yXiLKa($Nv`Kc4-9vTUd0`h9%dV(Phq)9^{Om3e&9!0cxzXH2>Tg04Q5=CuT zlFS(e*1IhNZ5T8li&6=(U>$dwa0G3*09E|pI^0#xvig?~AACZ?tqLZLM8g?(%j0FB zF51p8JUL8D_G!&aDXX#Ex3$%(t}qkQxOr++Asg^)Ok;$k=aS1?1?HD|t{b@VJWC6G zcJ8JmWbU4oy2!(wWvfDRabgX}6K&tm)=+%x-Yn(&+X(cH5yD5OFIH|YVq#8@Hh0NH5*v0no=LX0mYJ{$?e}b(Z*O;4 z`##;gLbA3?>3{7u_M$NILF07w<(ER7^*Xb;vq2Hi{wMMwm7m$N;~i`O@|itG@VUa3 zaNUw-Bh>r6QkPQSEG`_P(&=-SMZ=qrZNcIGcH}m?SheC+nE@A7w096(n=jBy&*o?>aXT^`(bgh(NLi`#Y9_52yw5|v(%IatnIT4X}jTQYrwrrmptz-FbDk{Kdla>YRmZlk{;cWvI= zYCbSsuzrKK$h(V}ozl8ig*?m=;=X1ot5{|zI8882UEt|bt*bG{FJ2_9ZxE73u(!Db zUXzSug38C~7;Q;rhCFP|-r;dKo%RAiLtFX>*mZ&v!xpT8xAKzm2KTr5EKFc(=qqNg zl9hNqKgzQ=$G5C-SL1pj9>`TV$$(jSBF_4` z>Xt>B!4)?dhA-g?Kjej3rB-KzpZ2|lNANgjUz-*nOGGEA4IruR>3q-{Og4n z{7d|{8p0;cZT4IGIKfT%i9#yE_KhR#ou`bq&l`QYnZx2>@n{yS*DP_m0lUlEIZDNq zqsF0Y@Z~5{9K}!gb>#Aoj=osFC6wq4Ta6PEz;i`V>39UWO$j~l%(`w4`_ z!~{C;kQ2YGi8gN|E6(ynYh)xJlglYZ#%y%;0zym5(2iR|m5ov8!jRE?1V4vPOJT)AcDgj@%W4)}Nyr7ZXq@L_0+}9z{S6}Z9 zR4<|H?K|B;)=y90W9e5@6YKS~crk02b^XG;dUwGl+lpvP$c?4)Gg39sgwZpf_H5OU z^oJ3>%%xjb6ngvwQsEASB8Kv#UDQbpWFZa3b3+mB}(+*ju; zPY?98U(WBtc+Kzk6JsNM3j_1xm6y(5h(7&eb+vA~u+)4>Sid4$&KQq-FcvJ8fO{HQ zOq_G~o>wT7*0>v2>C-#gpx%#uM0x9uFSs@R4L^g4J$yKtjX#8i2DUxOztWaHzvhSn zW$M14;@kMWZCihF>#KuDM%}10SZldSUBN`{nkW*)lJa<(Z}OdsF+ka_hSJh=dGgXr zDcKVenW9WNsXEb07rk}3@rPzs4z5Xlt0PPbEdyz8Bw3B0FeK5$@SiH8a#)iVFOnPfFlf}%zud}Yt=%b@9dg@|m z_vmBvHl^{YoU{pG+5}VD1gLca%tE1oRD0BZKmh{2y?OF^FM>?=es)iTM zUSYEt|H9Z;j1X%YjROcVg3!MH?FZ`ygt*czV(WkqV>%3$0)$A?NUTf{5xU1%MJ9+i zEj>?5qp?B%lV;FTMQk-S6{l6IXtxzWQZ1Y-3jlBm@ZYB@r4{>;2_pGdjPfos9-G4i z;WLR<0{~*LM)|7+2f+OUqRyzsg@-xX($VuX{KtN4c#%4OhFxL=05*640M7qb1XQIk zVBsK$_}>n6rnPh~VDB+Oc%`<}rt!x+1>+F9S4@OamKe*}lWZZ;WS1=@Sz<`m zu@hOdWdD!8@Av<{-#OoV&U2pUzV7RJ-s`^K^PKlw4axkq$^1|wU2+O$02mAgOoUfL zd4OaS;dn8i9TjO#dJdMPcpcr#mec`8qCc0T@KIWx^FR*!#i}e49z^gi zr8Aa&rS2@I#0VVdchWA5wPg-dmf@!J04DK%SF}VnXgj`du_X7|EBUaa}Ad?RCsl)B@F+rE0x7!sOpXq+Q3k2DyRL-aykI%y`&H;n%D zJO!inIgfSqHfHA~1j6L<-EVAQ1l!4TKLF@93##wqhOPzeS^dgXHPWR5|0)o6djJFg z4#)t2|875Ci<*Os)OXzU4=@}b41IF`G5!Q-CvV65Ue5Od#2$Egu4M;%kIS*PoNW}* zQv?iH#lAVJ2*O@1=T=k9)UQAB2n)x$*)ZMCbrVcCY<^ykI(W90PxuxJ7UtPT?EthHiS>p;fpqMJlY#xcg2U z@^j}6z3-D!t6|fzn_p>OC8&n$4VQN$h}Vs4@VO1^M90~?LgE>VfN`<8so0z@(^P2b z-iN{uMjYO;&k@_ayk#H3@e(S?WW+WwcjNFCjLZGg5t}J!FB0SipD@ zUBhP|5%y=Q#Fy#@Y(E7)-J6fNs@oUZ{hneTNGG6peZZqZI8SuONqzge4ezA>rBa4{ zwi?gmxED1HQ7thw^>Q$qdF9D>-{Dm%)<` zVo__>^Vm#GVv9GW)S_g`nlU!f(C#{;oVG28(z8#ziB}Q+X$)E_Ewg4`Yujy2Ul(}c zeQ+^9=_5Vm8cND}SSvftz1+N#%)J(g%rXxF$w~j!wzQFkd_Kvz-+sHR7HDVZa@_+n z6+66wd7<}#BZUT6pH2X8bCKqQFzZRS5}|CFuX*E5J|Il6)+2G7PB(+m*zTeikqG~R zw3>_NUNkS`{+ftc(YQy~RQ)a)< z53TvoA>pm)kB6JNA(`qWx;!B|a%_J)MKoq!*DdUiWYC<=-f(u!0#5Qr3vwn7WTYVb_l*fWK|vRIx&ps)i?5f?so*D z%P$*dd!Qfe941|`%Z9dO6%j?axEjkDq*e!66=m)Jd{6e1(ejLb=V>?hQY?K&O7LiK zODgx-$raNbR1NVBNObDJ|(ll8(H3n@`fmL0;FD$67G^yAdC z1@?#UdZ zX&Po5e7S#p`@5Ls@g)i|wW1uaWrXX4grtdw%$Cj-I;2&Xm`( zn-U`#aKylR$gkMmFt%&4yjsn0Eh529D|k7HRZ}t8KO*oQNNtJzaD7_*;m|x?a%+?^;5jj$;1g48dU4CTd4(wY2jsc4~yGndgu` zBw9t2IPIpT>0O&;9 z_cZA24o4o$7*nh<6yh<&9x~^=flnJ_+P8x83o$Z7p6y$Ot{U{eGBhrc7GNb+FDK@<{eUrys#zxd|V67KL`P0ZCXY9ws?6Wx)^NM2%s z_cD_EG-w=3{&#hm_o*3S5DYp(qYXKe;G-kQ&&3FvGbd?*ktjzDR)WZ-1phAi`H3yR zd!NQHJt;b!eO5&yzyG^=h&~5w7$InDbg&0EYlQp47<{AUG`S8js)r-PD1zD)aw8$A zOYxW)j>IHrkjka^1ItHnsl$+%M3HS+Fs4ys3egtFaxNTAYMJ6=U6Bqv+#F);9*Voh z_Wnl7kG`ns_LymZH}0ncLvhIlrFUe;7;oC#NjL3D7%VA3nc1ke^{YR*n8S*@>xw zV>?aAfE}7|-kIt~(sV&o-CX+v_rKswfkEaK{7?g@5ia(^IV)vd0;MtmmNjKBzWK0P zal7p5^jM+v-OoqWG*!)WydkaSZy|gVAP!wic{;~7_a*}zmcc`Z_v1)Pt<7n zOm{&LnTT;!hkv)akBVAzvago9mV0gsGyIE#(!f_4C2x8tmMq%h-~}3JzU-Syq0?Qj>3OwW>`$6hivt zcM#Ch#*~{(uxRE8`LkOOm}h@91|NP`nv5^DeW67-%H>Df^{ud=D36lD z(!izHo{ag^wl~OhGf)>RE*Ls3hcBw6`I(2DJs(xndUt)fnWdqICL)iKJ>G^zrSSB& z7;7k&uGK5uCx@2h;=Z7iK(K1B8<{hogCXoXTE;?{(4I)PGJZp^9hj2;c-u*@e;evz zx?EqJvHkv@e{W7{|Dl8(qe1>9n*D^VNEIr26ohKaNUDdUYUana4od_-e)X$ePQL|h zg?E+3j>{V%!y&uN@5DLHL@c|uq5XI^-HndLeoMXMM?j@vM=QsVLNwVQgnFjb%W4bZ zXcM!9`fzF~{v z23JoRN4s^9vt8&B@HTqfqq3O!(>lgx9BqfCE)`y-ec@VaVPQpimRj*Lpte%yePM;a zo=~s+fbt@1d@_8~r(~+xgUeh&J2PZx>|@hH#8&qw88UzS?@glws?K6pnADiRw8ok{ zhjbZ`R?38O^I`{2-&w}BOZ~D9lb_(Z=8LM;V6W0)e+q^%3_sY_LHuH(W{aFv23nu5 z?V}WMc2F%B$W35(W(YopZRsNL6E%0z6+)k?%}fZgcK{Zbp!Q{9?mZ_IOj9hzFTnOt zsJ-~(QOU;=5|6DoTjbbU%F3*%#LMqlvEaCDEG0r)e=jV|!M_aMm(5kS+rQpF^r&Vj znDs~SkVNrIlU|7r!N-g}O?}&M+t7kX9M6bso%U?_HC}~q@kOHT7QGJsR=pTGoa6ZG z1?d@Wc{Ygh+$$~`K4fe}b!>!ZY{WOxZO~E|DV-(dsH*~ws$VADjSa}Fx9Hy_f93iY z-x#^zx0Nv0)!+BAB(Se)70pjBM5c1wOE^9rX>$G zw37$gi+arn?D`QK%&GB7<){LYj7k!kAAuj_DJ3VZ@o4_{|Bsmnd!4%)d@HKud`_a1MBsBT{|lp&%%J!i z>yq*Oleca`;MS=iC_GwzG>VjbV%>tVZUK@88EKH$ShrAEtDSE;C)R=?sK_%=e#gB5K~%^R5lIyYW|)yKkPJ@#w^7E?Q9`(Yg*X%?K zW&nU5@Si6?3?K;r1bO>8U3PPJaB}vOJU4>>)Ff#oOOTS)$I(+kSX8rQ{z1R;zv$V7 zxF5|?06^aq03iFHcLDOl1aZ?;5UumVguo=}x-Cg}TjX(QFa&yz#gQ;z5v~LbaUwN| z4gx`5IM?nV$stKia Loading required package: nlmixr2 #> Loading required package: nlmixr2data # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/convert-nlmixr2.html","id":"converting-the-model-to-a-nlmixr2-fit","dir":"Articles","previous_headings":"Example","what":"Converting the model to a nlmixr2 fit","title":"Converting Monolix fit to nlmixr2 fit","text":"rxode2() model : Qualifies NONMEM model, nlmixr2 compatible residuals can convert nlmixr2 fit object babelmixr2:","code":"library(babelmixr2) fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object # If you want you can use nlmixr2, to add cwres to this fit: fit <- addCwres(fit) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → calculate jacobian #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate sensitivities #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate ∂(f)/∂(η) #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate ∂(R²)/∂(η) #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → finding duplicate expressions in inner model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in inner model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling inner model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → finding duplicate expressions in FD model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in FD model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → compiling events FD model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → Calculating residuals/tables #> ✔ done library(ggplot2) ggplot(fit, aes(PRED, CWRES)) + geom_point() + rxode2::rxTheme()"},{"path":"/articles/create-augPred.html","id":"step-1-convert-the-monolix-model-to-rxode2","dir":"Articles","previous_headings":"","what":"Step 1: Convert the Monolix model to rxode2:","title":"Created Augmented pred/ipred plots with `augPred()`","text":"","code":"library(monolix2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-augPred.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Created Augmented pred/ipred plots with `augPred()`","text":"can convert model, mod, nlmixr2 fit object:","code":"library(babelmixr2) # provides as.nlmixr2 #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit #> ── nlmixr² monolix2rx reading Monolix ver 5.1.1 ── #> #> OBJF AIC BIC Log-likelihood Condition#(Cov) #> monolix 118.9368 355.482 377.7819 -169.741 21.26161 #> Condition#(Cor) #> monolix 1.383153 #> #> ── Time (sec fit$time): ── #> #> setup optimize covariance table compress as.nlmixr2 #> elapsed 0.03108 4e-06 5e-06 0.055 0.006 2.074 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> #> Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% #> ka_pop 0.427 0.204 47.8 1.53 (1.03, 2.29) 75.4 1.05% #> V_pop -0.786 0.045 5.72 0.456 (0.417, 0.497) 12.7 13.3% #> Cl_pop -3.21 0.0837 2.61 0.0402 (0.0341, 0.0473) 27.6 2.65% #> a 0.433 0.433 #> b 0.0543 0.0543 #> #> Covariance Type (fit$covMethod): monolix2rx #> No correlations in between subject variability (BSV) matrix #> Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) #> Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink #> Censoring (fit$censInformation): No censoring #> Minimization message (fit$message): #> IPRED relative difference compared to Monolix IPRED: 0.04%; 95% percentile: (0%,0.52%); rtol=0.000379 #> PRED relative difference compared to Monolix PRED: 0%; 95% percentile: (0%,0%); rtol=4.94e-07 #> IPRED absolute difference compared to Monolix IPRED: atol=0.00253; 95% percentile: (0.000364, 0.00848) #> PRED absolute difference compared to Monolix PRED: atol=4.94e-07; 95% percentile: (1.13e-08, 0.000308) #> #> ── Fit Data (object fit is a modified tibble): ── #> # A tibble: 120 × 20 #> ID TIME DV PRED RES IPRED IRES IWRES omega_ka omega_V #> #> 1 1 0.25 2.84 2.78 0.0636 3.73 -0.887 -1.40 0.132 -0.183 #> 2 1 0.57 6.57 5.00 1.57 6.57 0.00239 0.00303 0.132 -0.183 #> 3 1 1.12 10.5 6.80 3.70 8.75 1.75 1.93 0.132 -0.183 #> # ℹ 117 more rows #> # ℹ 10 more variables: omega_Cl , CONC , depot , central , #> # ka , V , Cl , Cc , tad , dosenum "},{"path":"/articles/create-augPred.html","id":"step-3-create-and-plot-an-augmented-prediction","dir":"Articles","previous_headings":"","what":"Step 3: Create and plot an augmented prediction","title":"Created Augmented pred/ipred plots with `augPred()`","text":"","code":"ap <- augPred(fit) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ head(ap) #> values ind id time Endpoint #> 1 0.000000 Individual 1 0.000 depot #> 2 3.726962 Individual 1 0.250 depot #> 3 6.030526 Individual 1 0.493 depot #> 4 6.567601 Individual 1 0.570 depot #> 5 8.414706 Individual 1 0.986 depot #> 6 8.746028 Individual 1 1.120 depot # This augpred looks odd: plot(ap)"},{"path":"/articles/create-office.html","id":"step-1-import-the-model-into-monolix2rx","dir":"Articles","previous_headings":"","what":"Step 1: import the model into monolix2rx","title":"Create PowerPoint and Word documents using monolix2rx","text":"","code":"library(monolix2rx) library(babelmixr2) #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data library(nlmixr2rpt) library(onbrand) library(nonmem2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-office.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Create PowerPoint and Word documents using monolix2rx","text":"can convert model, mod, nlmixr2 fit object: cmt(depot)cmt(central)ka=exp(ka_pop+omega_ka)V=exp(V_pop+omega_V)Cl=exp(Cl_pop+omega_Cl)ddepotdt=−ka×depotdcentraldt=+ka×depot−ClV×centralCc=centralVCONC=CcCONC∼add()+prop(b)+combined1()\\begin{align*} cmt({depot}) \\\\ cmt({central}) \\\\ {ka} & = \\exp\\left({ka\\_pop}+{omega\\_ka}\\right) \\\\ {V} & = \\exp\\left({V\\_pop}+{omega\\_V}\\right) \\\\ {Cl} & = \\exp\\left({Cl\\_pop}+{omega\\_Cl}\\right) \\\\ \\frac{d \\: depot}{dt} & = -{ka} {\\times} {depot} \\\\ \\frac{d \\: central}{dt} & = +{ka} {\\times} {depot}-\\frac{{Cl}}{{V}} {\\times} {central} \\\\ {Cc} & = \\frac{{central}}{{V}} \\\\ {CONC} & = {Cc} \\\\ {CONC} & \\sim add({})+prop({b})+combined1() \\end{align*}","code":"fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit"},{"path":"/articles/create-office.html","id":"step-3-create-a-powerpoint-file","dir":"Articles","previous_headings":"","what":"Step 3: Create a PowerPoint file","title":"Create PowerPoint and Word documents using monolix2rx","text":"PowerPoint can created custom powerpoint templates, example use ones come nlmixr2rpt directly: gives powerpoint ","code":"obnd_pptx = read_template( template = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.pptx\"), mapping = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.yaml\")) obnd_pptx = report_fit( fit = fit, obnd = obnd_pptx) #> #> Attaching package: 'xpose' #> The following object is masked from 'package:stats': #> #> filter #> Registered S3 method overwritten by 'GGally': #> method from #> +.gg ggplot2 #> #> Attaching package: 'ggPMX' #> The following object is masked from 'package:xpose': #> #> get_data #> → Calculating residuals/tables #> ✔ done #> Warning in xpose.nlmixr2::xpose_data_nlmixr(fit): Added CWRES to fit (using #> nlmixr2::addCwres)... #> Skipping table: skip_table (NA found, not generated) #> Skipping figure: res_vs_pred_idv (NA found, not generated) #> Skipping figure: eta_cont (NA found, not generated) #> Skipping figure: eta_cat (NA found, not generated) #> Skipping figure: skip_figure (NA found, not generated) save_report(obnd_pptx, \"mod-PowerPoint.pptx\") #> $isgood #> [1] TRUE #> #> $msgs #> NULL"},{"path":"/articles/create-office.html","id":"step-4-create-a-word-file","dir":"Articles","previous_headings":"","what":"Step 4: Create a Word file","title":"Create PowerPoint and Word documents using monolix2rx","text":"Just like PowerPoint, can customizeown custom word templates, example use ones come nlmixr2rpt directly: gives word document ","code":"obnd_docx = read_template( template = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.docx\"), mapping = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.yaml\")) obnd_docx = report_fit( fit = fit, obnd = obnd_docx) #> → Calculating residuals/tables #> ✔ done #> Warning in xpose.nlmixr2::xpose_data_nlmixr(fit): Added CWRES to fit (using #> nlmixr2::addCwres)... #> Skipping figure: res_vs_pred_idv (NA found, not generated) #> Skipping figure: skip_figure (NA found, not generated) #> Skipping figure: eta_cont (NA found, not generated) #> Skipping figure: eta_cat (NA found, not generated) save_report(obnd_docx, \"mod-Word.docx\") #> $isgood #> [1] TRUE #> #> $msgs #> NULL"},{"path":"/articles/create-vpc.html","id":"step-1-convert-the-monolix-model-to-rxode2","dir":"Articles","previous_headings":"","what":"Step 1: Convert the Monolix model to rxode2:","title":"Easily Create a VPC using monolix2rx","text":"","code":"library(babelmixr2) #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data library(monolix2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-vpc.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Easily Create a VPC using monolix2rx","text":"can convert model, mod, nlmixr2 fit object:","code":"fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit #> ── nlmixr² monolix2rx reading Monolix ver 5.1.1 ── #> #> OBJF AIC BIC Log-likelihood Condition#(Cov) #> monolix 118.9368 355.482 377.7819 -169.741 21.26161 #> Condition#(Cor) #> monolix 1.383153 #> #> ── Time (sec fit$time): ── #> #> setup optimize covariance table compress as.nlmixr2 #> elapsed 0.034441 4e-06 6e-06 0.057 0.006 2.131 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> #> Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% #> ka_pop 0.427 0.204 47.8 1.53 (1.03, 2.29) 75.4 1.05% #> V_pop -0.786 0.045 5.72 0.456 (0.417, 0.497) 12.7 13.3% #> Cl_pop -3.21 0.0837 2.61 0.0402 (0.0341, 0.0473) 27.6 2.65% #> a 0.433 0.433 #> b 0.0543 0.0543 #> #> Covariance Type (fit$covMethod): monolix2rx #> No correlations in between subject variability (BSV) matrix #> Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) #> Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink #> Censoring (fit$censInformation): No censoring #> Minimization message (fit$message): #> IPRED relative difference compared to Monolix IPRED: 0.04%; 95% percentile: (0%,0.52%); rtol=0.000379 #> PRED relative difference compared to Monolix PRED: 0%; 95% percentile: (0%,0%); rtol=4.94e-07 #> IPRED absolute difference compared to Monolix IPRED: atol=0.00253; 95% percentile: (0.000364, 0.00848) #> PRED absolute difference compared to Monolix PRED: atol=4.94e-07; 95% percentile: (1.13e-08, 0.000308) #> #> ── Fit Data (object fit is a modified tibble): ── #> # A tibble: 120 × 20 #> ID TIME DV PRED RES IPRED IRES IWRES omega_ka omega_V #> #> 1 1 0.25 2.84 2.78 0.0636 3.73 -0.887 -1.40 0.132 -0.183 #> 2 1 0.57 6.57 5.00 1.57 6.57 0.00239 0.00303 0.132 -0.183 #> 3 1 1.12 10.5 6.80 3.70 8.75 1.75 1.93 0.132 -0.183 #> # ℹ 117 more rows #> # ℹ 10 more variables: omega_Cl , CONC , depot , central , #> # ka , V , Cl , Cc , tad , dosenum "},{"path":"/articles/create-vpc.html","id":"step-3-perform-the-vpc","dir":"Articles","previous_headings":"","what":"Step 3: Perform the VPC","title":"Easily Create a VPC using monolix2rx","text":"simply use vpcPlot() conjunction vpc package get regular prediction-corrected VPCs arrange single plot:","code":"library(ggplot2) p1 <- vpcPlot(fit, show=list(obs_dv=TRUE)) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ p1 <- p1 + ylab(\"Concentrations\") + rxode2::rxTheme() + xlab(\"Time (hr)\") + xgxr::xgx_scale_x_time_units(\"hour\", \"hour\") p1a <- p1 + xgxr::xgx_scale_y_log10() ## A prediction-corrected VPC p2 <- vpcPlot(fit, pred_corr = TRUE, show=list(obs_dv=TRUE)) p2 <- p2 + ylab(\"Prediction-Corrected Concentrations\") + rxode2::rxTheme() + xlab(\"Time (hr)\") + xgxr::xgx_scale_x_time_units(\"hour\", \"hour\") p2a <- p2 + xgxr::xgx_scale_y_log10() library(patchwork) (p1 * p1a) / (p2 * p2a) #> Warning in transformation$transform(x): NaNs produced #> Warning in ggplot2::scale_y_log10(..., breaks = breaks, minor_breaks = #> minor_breaks, : log-10 transformation introduced infinite #> values. #> Warning in transformation$transform(x): NaNs produced #> Warning in ggplot2::scale_y_log10(..., breaks = breaks, minor_breaks = #> minor_breaks, : log-10 transformation introduced infinite #> values."},{"path":"/articles/rxode2-validate.html","id":"comparing-differences-between-monolix-and-rxode2","dir":"Articles","previous_headings":"","what":"Comparing differences between Monolix and rxode2","title":"Qualify rxode2 model against Monolix","text":"may wish see differences predictions Monolix rxode2. rxode2 generated outputs compared Monolix generated outputs following items: Population Predictions: shows model translation adequate simulate general trends; validate structural model’s population parameters coupled model structure. Individual Predictions: shows model translation able replicate values subjects within modeling data-set. validates model can reproduce subject variability observed study. Individual Weighted Residuals: one step individual parameter validation, couples individual predictions, observations residual specification generate individual weighted residuals. included consistent nonmem2rx residuals. However, since needed manually adjust residual errors, simply looks errors converted correctly. Note: part validated three metrics subject covariance matrix, omega. assume correct long read correctly.","code":""},{"path":"/articles/rxode2-validate.html","id":"comparing-numerically","dir":"Articles","previous_headings":"","what":"Comparing numerically","title":"Qualify rxode2 model against Monolix","text":"want numerical differences, can also get modified returned ui object. rtol, atol follows : can see exactly match close (say validate). However can explore difference wish looking ipredCompare predCompare datasets: cases can see Monolix seems round values 5 digits, rxode2 keeps everything since solved R directly. Note observation data compared. Dosing predictions excluded comparisons. can also explore Monolix translated input dataset used make validation predictions (dosing observations) $monolixData item:","code":"mod$iwresAtol #> 50% #> 0.003054349 mod$iwresRtol #> 50% #> 0.01526897 mod$ipredAtol #> 50% #> 0.002537436 mod$ipredRtol #> 50% #> 0.0003802867 mod$predAtol #> 50% #> 3.657152e-06 mod$predAtol #> 50% #> 3.657152e-06 head(mod$iwresCompare) #> id time monolixIwres iwres cmt #> 1 1 0.25 -1.397760000 -1.395682322 CONC #> 2 1 0.57 0.000121543 0.003040162 CONC #> 3 1 1.12 1.928970000 1.932039320 CONC #> 4 1 12.12 0.440294000 0.431149277 CONC #> 5 1 2.02 0.196493000 0.198287572 CONC #> 6 1 24.37 0.713742000 0.699508374 CONC head(mod$ipredCompare) #> id time monolixIpred ipred cmt #> 1 1 0.25 3.72839 3.726960 CONC #> 2 1 0.57 6.56990 6.567599 CONC #> 3 1 1.12 8.74855 8.746027 CONC #> 4 1 12.12 5.61508 5.621679 CONC #> 5 1 2.02 9.47386 9.472175 CONC #> 6 1 24.37 2.85999 2.868060 CONC head(mod$predCompare) #> id time monolixPred cmt pred #> 1 1 0.25 2.77640 CONC 2.776402 #> 2 1 0.57 4.99610 CONC 4.996088 #> 3 1 1.12 6.80090 CONC 6.800893 #> 4 1 12.12 3.21554 CONC 3.215548 #> 5 1 2.02 7.41259 CONC 7.412585 #> 6 1 24.37 1.09158 CONC 1.091582 head(mod$monolixData) # with nlme loaded you can also use getData(mod) #> id amt time dv WEIGHT SEX cmt admd #> 1 1 4.02 0.00 NA 79.6 NA NA #> 2 1 NA 0.25 2.84 79.6 NA NA #> 3 1 NA 0.57 6.57 79.6 NA NA #> 4 1 NA 1.12 10.50 79.6 NA NA #> 5 1 NA 2.02 9.66 79.6 NA NA #> 6 1 NA 3.82 8.58 79.6 NA NA"},{"path":"/articles/rxode2-validate.html","id":"comparing-visually","dir":"Articles","previous_headings":"","what":"Comparing visually","title":"Qualify rxode2 model against Monolix","text":"easiest way visually compare differences plot method:","code":"plot(mod) # for general plot # you can also see individual comparisons plot(mod, log=\"y\", ncol=2, nrow=2, xlab=\"Time (hr)\", ylab=\"Concentrations\", page=1) # If you want all pages you could use: # plot(mod, log=\"y\", ncol=2, nrow=2, xlab=\"Time (hr)\", ylab=\"Concentrations\", page=TRUE)"},{"path":"/articles/rxode2-validate.html","id":"notes-on-validation","dir":"Articles","previous_headings":"","what":"Notes on validation","title":"Qualify rxode2 model against Monolix","text":"validation model uses best data available Monolix estimates. : theta population parameters eta individual parameters omega sigma matrices captured. nlmixr2 model fully qualified, IWRES validation ensures residual errors specified correctly. Otherwise omega sigma values contribute validation. Also overall covariance captured, used validation.","code":""},{"path":"/articles/simulate-extra-items.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate Derived Variables from imported Monolix model","text":"","code":"library(monolix2rx) library(rxode2) # First we need the location of the nonmem control stream Since we are running an example, we will use one of the built-in examples in `nonmem2rx` ctlFile <- system.file(\"mods/cpt/runODE032.ctl\", package=\"nonmem2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-extra-items.html","id":"step-2-add-auc-calculation","dir":"Articles","previous_headings":"","what":"Step 2: Add AUC calculation","title":"Simulate Derived Variables from imported Monolix model","text":"concentration case Cc model, trick get AUC additional ODE d/dt(AUC) <- Cc use reset get per dosing period. However, additional parameter part original model. calculation AUC depend number observations model, sparse data wouldn’t terribly accurate. One thing can use model piping append d/dt(AUC) <- Cc imported model: can also use append=NA pre-pend append=f put ODE right f line model.","code":"modAuc <- mod %>% model(d/dt(AUC) <- Cc, append=TRUE) #> → significant model change detected #> → kept in model: '$monolixData' #> → removed from model: '$admd', '$etaData', '$ipredAtol', '$ipredCompare', '$ipredRtol', '$iwresAtol', '$iwresCompare', '$iwresRtol', '$mlxtran', '$predAtol', '$predCompare', '$predIpredData', '$predRtol' modAuc #> ── rxode2-based free-form 3-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> 3 3 AUC #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> d/dt(AUC) <- Cc #> }) #> }"},{"path":"/articles/simulate-extra-items.html","id":"step-3-setup-event-table-to-calculate-the-auc-for-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 3: Setup event table to calculate the AUC for a different dosing paradigm:","title":"Simulate Derived Variables from imported Monolix model","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table. case since also wanting AUC per dosing period, can add reset dose AUC compartment every time dose given (track AUC current dose):","code":"ev <- et(amt=4, ii=12, until=24) %>% et(amt=0, ii=12, until=24, cmt=\"AUC\", evid=5) %>% # replace AUC with zero at dosing et(c(0, 4, 8, 11.999, 12, 12.01, 14, 20, 23.999, 24, 24.001, 28, 32, 36)) %>% et(id=1:10)"},{"path":"/articles/simulate-extra-items.html","id":"step-4-solve-using-rxode2","dir":"Articles","previous_headings":"","what":"Step 4: Solve using rxode2","title":"Simulate Derived Variables from imported Monolix model","text":"step, solve model new event table 10 subjects: Note since derived nonmem2rx model, default solving match tolerances methods specified NONMEM model.","code":"s <- rxSolve(modAuc, ev) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"/articles/simulate-extra-items.html","id":"step-5-exploring-the-simulation-by-plotting-and-summarizing-dplyr","dir":"Articles","previous_headings":"","what":"Step 5: Exploring the simulation (by plotting), and summarizing (dplyr)","title":"Simulate Derived Variables from imported Monolix model","text":"solved object acts rxode2 solved object, can use plot() function see individual running AUC profiles simulated: can also select points near dosing get AUC interval:","code":"library(ggplot2) plot(s, AUC) + ylab(\"Running AUC\") library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:data.table': #> #> between, first, last #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union s %>% filter(time %in% c(11.999, 23.999)) %>% mutate(time=round(time)) %>% select(id, time, AUC) #> id time AUC #> 1 1 12 71.67319 #> 2 1 24 102.46378 #> 3 2 12 62.73231 #> 4 2 24 91.10876 #> 5 3 12 62.42782 #> 6 3 24 86.37406 #> 7 4 12 44.99681 #> 8 4 24 59.71716 #> 9 5 12 58.29805 #> 10 5 24 81.99565 #> 11 6 12 51.33952 #> 12 6 24 66.40563 #> 13 7 12 71.35170 #> 14 7 24 95.19523 #> 15 8 12 57.10391 #> 16 8 24 81.70183 #> 17 9 12 51.23582 #> 18 9 24 67.72999 #> 19 10 12 45.90700 #> 20 10 24 61.53054"},{"path":"/articles/simulate-new-dosing.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate New dosing from Monolix model","text":"","code":"library(monolix2rx) library(rxode2) # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-new-dosing.html","id":"step-2-look-at-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 2: Look at a different dosing paradigm","title":"Simulate New dosing from Monolix model","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table:","code":"ev <- et(amt=4, ii=12, until=24) %>% et(list(c(0, 2), # add observations in windows c(4, 6), c(8, 12), c(14, 18), c(20, 26), c(28, 32), c(32, 36), c(36, 44))) %>% et(id=1:10)"},{"path":"/articles/simulate-new-dosing.html","id":"step-3-solve-using-rxode2","dir":"Articles","previous_headings":"","what":"Step 3: solve using rxode2","title":"Simulate New dosing from Monolix model","text":"step, solve model new event table 10 subjects: Note since nonmem2rx model, default solving match tolerances methods specified NONMEM model.","code":"s <- rxSolve(mod, ev) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"/articles/simulate-new-dosing.html","id":"step-4-exploring-the-simulation-by-plotting","dir":"Articles","previous_headings":"","what":"Step 4: exploring the simulation (by plotting)","title":"Simulate New dosing from Monolix model","text":"solved object acts rxode2 solved object, can use plot() function see individual profiles simulated:","code":"library(ggplot2) plot(s, ipredSim) + ylab(\"Concentrations\")"},{"path":"/articles/simulate-uncertainty.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate using Parameter Uncertainty","text":"","code":"library(monolix2rx) library(rxode2) # its best practice to set the seed for the simulations set.seed(42) rxSetSeed(42) # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-uncertainty.html","id":"step-2-look-at-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 2: Look at a different dosing paradigm","title":"Simulate using Parameter Uncertainty","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table.","code":"ev <- et(amt=4, ii=12, until=24) %>% et(c(1:6, seq(8, 24, by=2))) %>% et(id=1:100)"},{"path":"/articles/simulate-uncertainty.html","id":"step-3-solve-using-the-uncertainty-in-the-nonmem-model","dir":"Articles","previous_headings":"","what":"Step 3: Solve using the uncertainty in the NONMEM model","title":"Simulate using Parameter Uncertainty","text":"use uncertainty model, simple matter telling many times rxode2() sample nStud=X. case use 100.","code":"s <- rxSolve(mod, ev, nStud=100) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using dfSub=12 from Monolix #> ℹ using dfObs=120 from Monolix #> ℹ using thetaMat from Monolix #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 s #> ── Solved rxode2 object ── #> ── Parameters (x$params): ── #> # A tibble: 10,000 × 10 #> sim.id id ka_pop V_pop Cl_pop a b omega_ka omega_V omega_Cl #> #> 1 1 1 0.281 -0.770 -3.22 0.475 0.0653 0.470 -0.208 0.483 #> 2 1 2 0.281 -0.770 -3.22 0.475 0.0653 0.654 0.0861 0.129 #> 3 1 3 0.281 -0.770 -3.22 0.475 0.0653 -0.0747 0.168 0.500 #> 4 1 4 0.281 -0.770 -3.22 0.475 0.0653 0.126 -0.0226 0.479 #> 5 1 5 0.281 -0.770 -3.22 0.475 0.0653 -0.162 0.000264 -0.205 #> 6 1 6 0.281 -0.770 -3.22 0.475 0.0653 -1.13 -0.239 0.0941 #> 7 1 7 0.281 -0.770 -3.22 0.475 0.0653 -0.335 0.0134 0.00490 #> 8 1 8 0.281 -0.770 -3.22 0.475 0.0653 -0.869 -0.239 0.000511 #> 9 1 9 0.281 -0.770 -3.22 0.475 0.0653 1.35 -0.122 0.667 #> 10 1 10 0.281 -0.770 -3.22 0.475 0.0653 0.314 0.0494 -0.552 #> # ℹ 9,990 more rows #> ── Initial Conditions (x$inits): ── #> depot central #> 0 0 #> #> Simulation with uncertainty in: #> • parameters (x$thetaMat for changes) #> • omega matrix (x$omegaList) #> • sigma matrix (x$sigmaList) #> #> ── First part of data (object): ── #> # A tibble: 150,000 × 12 #> sim.id id time ka V Cl Cc CONC ipredSim sim depot #> #> 1 1 1 1 2.12 0.376 0.0646 8.36 8.36 8.36 8.50 0.481 #> 2 1 1 2 2.12 0.376 0.0646 8.04 8.04 8.04 9.71 0.0577 #> 3 1 1 3 2.12 0.376 0.0646 6.90 6.90 6.90 7.77 0.00694 #> 4 1 1 4 2.12 0.376 0.0646 5.82 5.82 5.82 5.07 0.000833 #> 5 1 1 5 2.12 0.376 0.0646 4.91 4.91 4.91 4.91 0.000100 #> 6 1 1 6 2.12 0.376 0.0646 4.13 4.13 4.13 3.79 0.0000121 #> # ℹ 149,994 more rows #> # ℹ 1 more variable: central "},{"path":"/articles/simulate-uncertainty.html","id":"step-4-summarize-and-plot","dir":"Articles","previous_headings":"","what":"Step 4: Summarize and plot","title":"Simulate using Parameter Uncertainty","text":"Since bunch data, confidence band simulation uncertainty helpful. One way select interesting components, create confidence interval plot confidence bands:","code":"sci <- confint(s, parm=c(\"CONC\", \"sim\")) #> summarizing data...done sci #> # A tibble: 90 × 7 #> p1 time trt p2.5 p50 p97.5 Percentile #> #> 1 0.0250 1 CONC 0.741 2.40 4.39 2.5% #> 2 0.5 1 CONC 4.21 6.21 7.25 50% #> 3 0.975 1 CONC 7.89 9.32 11.1 97.5% #> 4 0.0250 2 CONC 1.33 3.80 5.59 2.5% #> 5 0.5 2 CONC 5.76 6.94 7.45 50% #> 6 0.975 2 CONC 8.22 9.14 10.6 97.5% #> 7 0.0250 3 CONC 1.79 4.36 5.42 2.5% #> 8 0.5 3 CONC 6.04 6.66 7.05 50% #> 9 0.975 3 CONC 7.79 8.71 9.99 97.5% #> 10 0.0250 4 CONC 2.12 4.36 5.26 2.5% #> # ℹ 80 more rows p1 <- plot(sci) p2 <- plot(sci, log=\"y\") library(patchwork) p1/p2"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Matthew Fidler. Author, maintainer. Justin Wilkins. Contributor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Fidler M (2024). monolix2rx: 'monolix2rx' Converts 'Monolix' Models 'rxode2'. R package version 0.0.1.","code":"@Manual{, title = {monolix2rx: 'monolix2rx' Converts 'Monolix' Models to 'rxode2'}, author = {Matthew Fidler}, year = {2024}, note = {R package version 0.0.1}, }"},{"path":"/index.html","id":"monolix2rx-","dir":"","previous_headings":"","what":"monolix2rx Converts Monolix Models to rxode2","title":"monolix2rx Converts Monolix Models to rxode2","text":"goal monolix2rx convert Monolix rxode2 use simulation sharing model open-source framework.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"monolix2rx Converts Monolix Models to rxode2","text":"can install development version monolix2rx GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"nlmixr2/monolix2rx\")"},{"path":"/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"monolix2rx Converts Monolix Models to rxode2","text":"trying convert Monolix rxode2 model simply need path mlxtran file. example, classic demo theophylline included monolix2rx can imported :","code":"library(monolix2rx) # First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # file as a text file (hence you can access without model library). # Additionally some of the file paths were shortened so they could # be included with monolix2rx pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mlxtranFile <- file.path(pkgTheo, \"theophylline_project.mlxtran\") rx <- monolix2rx(mlxtranFile) #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done rx #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop + V_pop + Cl_pop ~ c(0.09785, 0.00082606, 0.00041937, #> -4.2833e-05, -6.7957e-06, 1.1318e-05) #> a + b ~ c(0.015333, -0.0026458, 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> } # If you are only interseted in the parsing you can use `mlxtran` mlx <- mlxtran(mlxtranFile) #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done mlx #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [FILEINFO] #> ; parsed: $DATAFILE$FILEINFO$FILEINFO #> file = 'data/theophylline_data.txt' #> delimiter = tab #> header = {ID, AMT, TIME, CONC, WEIGHT, SEX} #> #> [CONTENT] #> ; parsed: $DATAFILE$CONTENT$CONTENT #> ID = {use=identifier} #> TIME = {use=time} #> AMT = {use=amount} #> CONC = {use=observation, name=CONC, type=continuous} #> WEIGHT = {use=covariate, type=continuous} #> SEX = {use=covariate, type=categorical} #> #> #> [INDIVIDUAL] #> ; parsed: $MODEL$INDIVIDUAL$INDIVIDUAL #> input = {ka_pop, omega_ka, V_pop, omega_V, Cl_pop, omega_Cl} #> #> DEFINITION: #> ; parsed: $MODEL$INDIVIDUAL$DEFINITION #> ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} #> V = {distribution=lognormal, typical=V_pop, sd=omega_V} #> Cl = {distribution=lognormal, typical=Cl_pop, sd=omega_Cl} #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {a, b, ka, V, Cl} #> file = 'oral1_1cpt_kaVCl.txt' #> #> DEFINITION: #> ; parsed: $MODEL$LONGITUDINAL$DEFINITION #> CONC = {distribution=normal, prediction=Cc, errorModel=combined1(a, b)} #> #> EQUATION: #> #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc #> #> #> ; parsed: $FIT$FIT #> data = {CONC} #> model = {CONC} #> #> #> ; parsed: $PARAMETER$PARAMETER #> Cl_pop = {value=0.1, method=MLE} #> V_pop = {value=0.5, method=MLE} #> a = {value=1, method=MLE} #> b = {value=0.3, method=MLE} #> ka_pop = {value=1, method=MLE} #> omega_Cl = {value=1, method=MLE} #> omega_V = {value=1, method=MLE} #> omega_ka = {value=1, method=MLE} #> #> #> [TASKS] #> ; parsed: $MONOLIX$TASKS$TASKS #> populationParameters() #> individualParameters(method = {conditionalMean, conditionalMode}) #> fim(method = Linearization) #> logLikelihood(method = Linearization) #> plotResult(method = {indfits, obspred, vpc, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) #> #> [SETTINGS] #> GLOBAL: #> ; parsed: $MONOLIX$SETTINGS$GLOBAL #> exportpath = 'tp' #> #> ; unparsed sections: #> ; $MODEL$LONGITUDINAL$EQUATION # this can be converted to a list mlx <- as.list(mlx) mlx$DATAFILE$FILEINFO$FILEINFO #> $file #> [1] \"data/theophylline_data.txt\" #> #> $header #> [1] \"ID\" \"AMT\" \"TIME\" \"CONC\" \"WEIGHT\" \"SEX\" #> #> $delimiter #> [1] \"tab\""},{"path":"/index.html","id":"translating-models-from-the-monolix-model-library","dir":"","previous_headings":"","what":"Translating models from the Monolix model library","title":"monolix2rx Converts Monolix Models to rxode2","text":"models using Monolix’s model library, models may accessible text files versions Monolix. mlxtran files may see something like: older versions Monolix, model libraries group text files. can find looking file Monolix library like bolus_1cpt_TlagVCl.txt. case pk/bolus_1cpt_TlagVCl.txt. parent directory model library. access files (even old version Monolix) can make monolix2rx aware model library using: Unix, can symbolic link whatever model library like use. can check see works trying translate model file rxode2: computer setup correctly (like ) see translated model. Note since isn’t mlxtran file relationship population parameters, subject variability etc initial parameter estimates model. model library setup correctly see found old model library get: newer versions Monolix, model library turned binary database accessed GUI lixoftConnectors. lixoftConnectors system can successfully load model lixoftConnectors::getLibraryModelContent() monolix2rx also load model correctly (use version text files setup) means need import models rxode2 need : model built model library need: path text file Monolix Library setup monolix2rx.library options(monolix2rx.library=\"~/src/monolix/library/\") lixoftConnectors installed connected newer (licensed) version Monolix can get model library content lixoftConnectors::getLibraryModelContent() without options, need save model text file outside model library can import model.","code":"lib:bolus_1cpt_TlagVCl.txt # If the model library was located in ~/src/monolix/library # Then you would set the model library up as follows: options(monolix2rx.library=\"~/src/monolix/library/\") monolix2rx(\"lib:bolus_1cpt_TlagVCl.txt\") #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ cannot find individual parameter estimates #> ── rxode2-based free-form 1-cmt ODE model ────────────────────────────────────── #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 central #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is via a bolus with a lag time (Tlag).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\" #> model({ #> cmt(central) #> d/dt(central) <- -Cl/V * central #> alag(central) <- Tlag #> Cc <- central/V #> }) #> } try(monolix2rx(\"lib:notThere.txt\")) #> Warning in .mlxtranLib(file): while options('monolix2rx.library') is set, could not find model file 'lib:notThere.txt' #> please save the model to translate #> Error : could not find the model file"},{"path":"/index.html","id":"note-on-testing","dir":"","previous_headings":"","what":"Note on testing","title":"monolix2rx Converts Monolix Models to rxode2","text":"tests package include testing Monolix demo files, Monolix library files (available), Monolix validation suite. Since part Monolix , included package. can setup monolix2rx run tests files well setting options:","code":"# setup monolix library (and will test that the parsing and translation are as expected) options(monolix2rx.library=\"~/src/monolix/library/\") # setup monolix demos to be tested options(monolix2rx.demo=\"~/src/monolix/demos/\")"},{"path":"/reference/autoplot.monolix2rx.html","id":null,"dir":"Reference","previous_headings":"","what":"Autoplot monolix2rx object — autoplot.monolix2rx","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"Autoplot monolix2rx object","code":""},{"path":"/reference/autoplot.monolix2rx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"","code":"# S3 method for class 'monolix2rx' autoplot( object, ..., ncol = 3, nrow = 3, log = \"\", xlab = \"Time\", ylab = \"Predictions\", page = FALSE )"},{"path":"/reference/autoplot.monolix2rx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"object object, whose class determine behaviour autoplot ... ignored parameters monolix2rx objects nrow, ncol Number rows columns log \"\" (neither x y), \"x\", \"y\", \"xy\" (\"yx\") log-scale? xlab, ylab x y axis labels page number page(s) individual plots, default (FALSE) pages print; can use TRUE pages print, list pages want print","code":""},{"path":"/reference/autoplot.monolix2rx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"ggplot2 object","code":""},{"path":"/reference/dot-getNbdoses.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of doses for steady state for monolix2rx — .getNbdoses","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Get number doses steady state monolix2rx","code":""},{"path":"/reference/dot-getNbdoses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"","code":".getNbdoses(x)"},{"path":"/reference/dot-getNbdoses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"x monolix2rx object","code":""},{"path":"/reference/dot-getNbdoses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Number doses monolix2rx object","code":""},{"path":"/reference/dot-getNbdoses.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Matthew L. Fidler","code":""},{"path":"/reference/dot-getStiff.html","id":null,"dir":"Reference","previous_headings":"","what":"Get if the model object is stiff — .getStiff","title":"Get if the model object is stiff — .getStiff","text":"Get model object stiff","code":""},{"path":"/reference/dot-getStiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get if the model object is stiff — .getStiff","text":"","code":".getStiff(x)"},{"path":"/reference/dot-getStiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get if the model object is stiff — .getStiff","text":"x monolix2rx object","code":""},{"path":"/reference/dot-getStiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get if the model object is stiff — .getStiff","text":"boolean indicating object stiff system (indicated monolix)","code":""},{"path":"/reference/dot-getStiff.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get if the model object is stiff — .getStiff","text":"Matthew L. Fidler","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"Get best mlxtran info return NULL","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"","code":".monolixGetMlxtran(x)"},{"path":"/reference/dot-monolixGetMlxtran.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"x item try extract mlxtran info","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"mlxtran info","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxTxt.html","id":null,"dir":"Reference","previous_headings":"","what":"Get equation block from a Monolix model txt file — mlxTxt","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"Get equation block Monolix model txt file","code":""},{"path":"/reference/mlxTxt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"","code":"mlxTxt(file, retFile = FALSE)"},{"path":"/reference/mlxTxt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"file string representing model text file. Can lib:fileName.txt library setup/available retFile boolean tells mlxTxt() return file name instead error file exist","code":""},{"path":"/reference/mlxTxt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"parsed equation file name","code":""},{"path":"/reference/mlxTxt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxTxt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mod <- mlxTxt(file.path(pkgTheo, \"oral1_1cpt_kaVCl.txt\")) mod #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {ka, V, Cl} #> #> EQUATION: #> ; parsed: $MODEL$LONGITUDINAL$EQUATION #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc"},{"path":"/reference/mlxtran.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and parse mlxtran lines — mlxtran","title":"Read and parse mlxtran lines — mlxtran","text":"Read parse mlxtran lines","code":""},{"path":"/reference/mlxtran.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and parse mlxtran lines — mlxtran","text":"","code":"mlxtran(file, equation = FALSE, update = FALSE)"},{"path":"/reference/mlxtran.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and parse mlxtran lines — mlxtran","text":"file mlxtran file process equation parse equation block rxode2 (models translated) update true, try update parameter block final parameter estimates","code":""},{"path":"/reference/mlxtran.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and parse mlxtran lines — mlxtran","text":"mlxtran object","code":""},{"path":"/reference/mlxtran.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read and parse mlxtran lines — mlxtran","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxtran.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and parse mlxtran lines — mlxtran","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mlx <- mlxtran(file.path(pkgTheo, \"theophylline_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done mlx #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [FILEINFO] #> ; parsed: $DATAFILE$FILEINFO$FILEINFO #> file = 'data/theophylline_data.txt' #> delimiter = tab #> header = {ID, AMT, TIME, CONC, WEIGHT, SEX} #> #> [CONTENT] #> ; parsed: $DATAFILE$CONTENT$CONTENT #> ID = {use=identifier} #> TIME = {use=time} #> AMT = {use=amount} #> CONC = {use=observation, name=CONC, type=continuous} #> WEIGHT = {use=covariate, type=continuous} #> SEX = {use=covariate, type=categorical} #> #> #> [INDIVIDUAL] #> ; parsed: $MODEL$INDIVIDUAL$INDIVIDUAL #> input = {ka_pop, omega_ka, V_pop, omega_V, Cl_pop, omega_Cl} #> #> DEFINITION: #> ; parsed: $MODEL$INDIVIDUAL$DEFINITION #> ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} #> V = {distribution=lognormal, typical=V_pop, sd=omega_V} #> Cl = {distribution=lognormal, typical=Cl_pop, sd=omega_Cl} #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {a, b, ka, V, Cl} #> #> DEFINITION: #> ; parsed: $MODEL$LONGITUDINAL$DEFINITION #> CONC = {distribution=normal, prediction=Cc, errorModel=combined1(a, b)} #> #> EQUATION: #> #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc #> #> #> ; parsed: $FIT$FIT #> data = {CONC} #> model = {CONC} #> #> #> ; parsed: $PARAMETER$PARAMETER #> Cl_pop = {value=0.1, method=MLE} #> V_pop = {value=0.5, method=MLE} #> a = {value=1, method=MLE} #> b = {value=0.3, method=MLE} #> ka_pop = {value=1, method=MLE} #> omega_Cl = {value=1, method=MLE} #> omega_V = {value=1, method=MLE} #> omega_ka = {value=1, method=MLE} #> #> #> [TASKS] #> ; parsed: $MONOLIX$TASKS$TASKS #> populationParameters() #> individualParameters(method = {conditionalMean, conditionalMode}) #> fim(method = Linearization) #> logLikelihood(method = Linearization) #> plotResult(method = {indfits, obspred, vpc, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) #> #> [SETTINGS] #> GLOBAL: #> ; parsed: $MONOLIX$SETTINGS$GLOBAL #> exportpath = 'tp' #> #> ; unparsed sections: #> ; $MODEL$LONGITUDINAL$EQUATION"},{"path":"/reference/monolix2rx.html","id":null,"dir":"Reference","previous_headings":"","what":"Translate a monolix file to rxode2 — monolix2rx","title":"Translate a monolix file to rxode2 — monolix2rx","text":"Translate monolix file rxode2","code":""},{"path":"/reference/monolix2rx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Translate a monolix file to rxode2 — monolix2rx","text":"","code":"monolix2rx( mlxtran, update = TRUE, thetaMatType = c(\"sa\", \"lin\"), sd = 1, cor = 1e-05, theta = 0.5, ci = 0.95, sigdig = 3, envir = parent.frame() )"},{"path":"/reference/monolix2rx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Translate a monolix file to rxode2 — monolix2rx","text":"mlxtran file name mlxtran translate rxode2 update boolean represents final parameter estimates used translation (present) thetaMatType lists preferred source thetaMat covariance matrix. default sa simulated annealing, though use lin linearized covariance calculation. one present, use whatever present sd Default standard deviation subject variability/inter-occasion variability missing. cor Default correlation missing correlations estimate theta default population estimate ci confidence interval validation, default 0.95 sigdig number significant digits validation, default 3 envir represents environment used evaluating corresponding rxode2 function","code":""},{"path":"/reference/monolix2rx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Translate a monolix file to rxode2 — monolix2rx","text":"rxode2 model","code":""},{"path":"/reference/monolix2rx.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Translate a monolix file to rxode2 — monolix2rx","text":"Matthew L. Fidler","code":""},{"path":"/reference/monolix2rx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Translate a monolix file to rxode2 — monolix2rx","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") rx <- monolix2rx(file.path(pkgTheo, \"theophylline_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning: NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> #> #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done pkgCov <- system.file(\"cov\", package=\"monolix2rx\") rx <- monolix2rx(file.path(pkgCov, \"warfarin_covariate3_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_TlagkaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesSA.txt #> ℹ done #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> #> #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done rx #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> Tlag_pop ka_pop V_pop Cl_pop beta_V_tSex_F #> -0.25949800 0.35610590 2.13606937 -2.00665359 -0.38227857 #> beta_Cl_tSex_F a b #> -0.09383651 0.24818991 0.05086658 #> #> Omega ($omega): #> omega_Tlag omega_ka omega_V omega_Cl #> omega_Tlag 0.3836648 0.0000000 0.00000000 0.00000000 #> omega_ka 0.0000000 0.9857194 0.00000000 0.00000000 #> omega_V 0.0000000 0.0000000 0.02782834 0.00000000 #> omega_Cl 0.0000000 0.0000000 0.00000000 0.08142194 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level covariates #> 1 Tlag_pop omega_Tlag id #> 2 ka_pop omega_ka id #> 3 V_pop omega_V id (tSex == \"F\")*beta_V_tSex_F #> 4 Cl_pop omega_Cl id (tSex == \"F\")*beta_Cl_tSex_F #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka) and a lag time (Tlag).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\" #> dfObs <- 479 #> dfSub <- 32 #> thetaMat <- lotri({ #> Tlag_pop ~ c(Tlag_pop = 0.0695270111760315) #> ka_pop ~ c(Tlag_pop = 0.00420093609313868, ka_pop = 0.195044017895198) #> V_pop ~ c(Tlag_pop = -1.96027567180685e-05, ka_pop = -0.00923639238851991, #> V_pop = 0.0894995626339569) #> beta_V_tSex_F ~ c(Tlag_pop = 0.000672864307227817, ka_pop = 0.00146099695978716, #> V_pop = -0.0105938787089785, beta_V_tSex_F = 0.00724034) #> Cl_pop ~ c(Tlag_pop = 3.33517518294536e-05, ka_pop = -0.000198349948605509, #> V_pop = 1.64480523051151e-05, beta_V_tSex_F = -2.52790128781238e-06, #> Cl_pop = 5.67721912406063e-05) #> beta_Cl_tSex_F ~ c(Tlag_pop = 4.97719167561125e-05, ka_pop = 0.00116960996255074, #> V_pop = -0.000127036295934593, beta_V_tSex_F = -1.29385e-06, #> Cl_pop = -0.000421700477175592, beta_Cl_tSex_F = 0.0199246) #> omega_Tlag ~ c(Tlag_pop = -0.0670860109353223, ka_pop = 0.00570893614027221, #> V_pop = 0.00299407684209903, beta_V_tSex_F = -0.00119581, #> Cl_pop = 2.03533460988456e-06, beta_Cl_tSex_F = -0.00034514, #> omega_Tlag = 0.116943) #> omega_ka ~ c(Tlag_pop = -0.0133385617208073, ka_pop = 0.0172356179141179, #> V_pop = 0.00171771988746332, beta_V_tSex_F = -0.000442385, #> Cl_pop = 7.3966470999696e-05, beta_Cl_tSex_F = -0.000725679, #> omega_Tlag = 0.0139898, omega_ka = 0.0694802) #> omega_V ~ c(Tlag_pop = -0.000154212149163577, ka_pop = 0.000300664573505569, #> V_pop = 4.67557030887738e-05, beta_V_tSex_F = -1.72411e-06, #> Cl_pop = -2.66907442804329e-06, beta_Cl_tSex_F = 2.11319e-05, #> omega_Tlag = 0.000296489, omega_ka = -0.000253742, #> omega_V = 0.000656055) #> omega_Cl ~ c(Tlag_pop = -0.00020876675474306, ka_pop = 0.000203991029463676, #> V_pop = -4.25014903301396e-05, beta_V_tSex_F = 1.01086e-05, #> Cl_pop = -4.27528356071897e-07, beta_Cl_tSex_F = -3.1184e-05, #> omega_Tlag = 0.000190543, omega_ka = -0.000195656, #> omega_V = 3.1147e-06, omega_Cl = 0.00133407) #> a ~ c(Tlag_pop = 0.000459922525965396, ka_pop = -0.000402122537073151, #> V_pop = -0.00035759769526248, beta_V_tSex_F = -5.67417e-07, #> Cl_pop = 4.93306085861609e-06, beta_Cl_tSex_F = 5.18592e-05, #> omega_Tlag = -0.000767474, omega_ka = -0.000402704, #> omega_V = -3.56563e-05, omega_Cl = 5.77815e-05, a = 0.00146135) #> b ~ c(Tlag_pop = -4.42123891106805e-05, ka_pop = 6.74134848256571e-05, #> V_pop = 0.000102247569651447, beta_V_tSex_F = -4.84525e-06, #> Cl_pop = -7.84308816660971e-07, beta_Cl_tSex_F = -4.64896e-06, #> omega_Tlag = 5.67197e-05, omega_ka = 4.06959e-05, #> omega_V = -4.39519e-06, omega_Cl = -1.31481e-05, #> a = -0.000214637, b = 5.66332e-05) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.39%; 95% percentile: (0.02%,3.18%); rtol=0.00394\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (8.49e-05, 0.166); atol=0.0175\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=1.21e-06\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.87e-08, 4.92e-05); atol=6.07e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.24%,204.01%); rtol=0.0794\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.0026, 0.33); atol=0.0362\") #> ini({ #> Tlag_pop <- -0.259498000083172 #> ka_pop <- 0.356105897545116 #> V_pop <- 2.1360693683596 #> Cl_pop <- -2.00665359474148 #> beta_V_tSex_F <- -0.382278567256413 #> beta_Cl_tSex_F <- -0.0938365059053137 #> a <- c(0, 0.24818990819019) #> b <- c(0, 0.0508665778176092) #> omega_Tlag ~ 0.383664766381593 #> omega_ka ~ 0.985719433448741 #> omega_V ~ 0.0278283386496708 #> omega_Cl ~ 0.0814219400052839 #> }) #> model({ #> cmt(depot) #> cmt(central) #> if (sex == 0) { #> tSex <- \"F\" #> } #> else if (sex == 1) { #> tSex <- \"M\" #> } #> else { #> tSex <- \"M\" #> } #> Tlag <- exp(Tlag_pop + omega_Tlag) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + beta_V_tSex_F * (tSex == \"F\") + omega_V) #> Cl <- exp(Cl_pop + beta_Cl_tSex_F * (tSex == \"F\") + omega_Cl) #> d/dt(depot) <- -ka * depot #> alag(depot) <- Tlag #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> concentration <- Cc #> concentration ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. ggplot2 autoplot lotri lotri magrittr %>% rxode2 expit, ini, logit, model, model<-, rxode, RxODE, rxode2, rxRename, rxSolve, rxUiGet","code":""},{"path":"/news/index.html","id":"monolix2rx-001","dir":"Changelog","previous_headings":"","what":"monolix2rx 0.0.1","title":"monolix2rx 0.0.1","text":"Initial CRAN submission.","code":""}] +[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 monolix2rx authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"/articles/convert-nlmixr2.html","id":"creating-a-nlmixr2-compatible-model","dir":"Articles","previous_headings":"","what":"Creating a nlmixr2 compatible model","title":"Converting Monolix fit to nlmixr2 fit","text":"Unlike nonmem2rx, residuals specification can converted efficiently nlmixr2 residual syntax.","code":""},{"path":"/articles/convert-nlmixr2.html","id":"example","dir":"Articles","previous_headings":"","what":"Example","title":"Converting Monolix fit to nlmixr2 fit","text":"","code":"library(babelmixr2) # will re-export much of monolix2rx #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/convert-nlmixr2.html","id":"converting-the-model-to-a-nlmixr2-fit","dir":"Articles","previous_headings":"Example","what":"Converting the model to a nlmixr2 fit","title":"Converting Monolix fit to nlmixr2 fit","text":"rxode2() model : Qualifies NONMEM model, nlmixr2 compatible residuals can convert nlmixr2 fit object babelmixr2:","code":"library(babelmixr2) fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object # If you want you can use nlmixr2, to add cwres to this fit: fit <- addCwres(fit) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → calculate jacobian #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate sensitivities #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate ∂(f)/∂(η) #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → calculate ∂(R²)/∂(η) #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → finding duplicate expressions in inner model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in inner model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling inner model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → finding duplicate expressions in FD model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in FD model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → compiling events FD model... #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ✔ done #> → Calculating residuals/tables #> ✔ done library(ggplot2) ggplot(fit, aes(PRED, CWRES)) + geom_point() + rxode2::rxTheme()"},{"path":"/articles/create-augPred.html","id":"step-1-convert-the-monolix-model-to-rxode2","dir":"Articles","previous_headings":"","what":"Step 1: Convert the Monolix model to rxode2:","title":"Created Augmented pred/ipred plots with `augPred()`","text":"","code":"library(monolix2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-augPred.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Created Augmented pred/ipred plots with `augPred()`","text":"can convert model, mod, nlmixr2 fit object:","code":"library(babelmixr2) # provides as.nlmixr2 #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit #> ── nlmixr² monolix2rx reading Monolix ver 5.1.1 ── #> #> OBJF AIC BIC Log-likelihood Condition#(Cov) #> monolix 118.9368 355.482 377.7819 -169.741 21.26161 #> Condition#(Cor) #> monolix 1.383153 #> #> ── Time (sec fit$time): ── #> #> setup optimize covariance table compress as.nlmixr2 #> elapsed 0.034833 4e-06 6e-06 0.059 0.007 2.204 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> #> Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% #> ka_pop 0.427 0.204 47.8 1.53 (1.03, 2.29) 75.4 1.05% #> V_pop -0.786 0.045 5.72 0.456 (0.417, 0.497) 12.7 13.3% #> Cl_pop -3.21 0.0837 2.61 0.0402 (0.0341, 0.0473) 27.6 2.65% #> a 0.433 0.433 #> b 0.0543 0.0543 #> #> Covariance Type (fit$covMethod): monolix2rx #> No correlations in between subject variability (BSV) matrix #> Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) #> Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink #> Censoring (fit$censInformation): No censoring #> Minimization message (fit$message): #> IPRED relative difference compared to Monolix IPRED: 0.04%; 95% percentile: (0%,0.52%); rtol=0.000379 #> PRED relative difference compared to Monolix PRED: 0%; 95% percentile: (0%,0%); rtol=4.94e-07 #> IPRED absolute difference compared to Monolix IPRED: atol=0.00253; 95% percentile: (0.000364, 0.00848) #> PRED absolute difference compared to Monolix PRED: atol=4.94e-07; 95% percentile: (1.13e-08, 0.000308) #> #> ── Fit Data (object fit is a modified tibble): ── #> # A tibble: 120 × 20 #> ID TIME DV PRED RES IPRED IRES IWRES omega_ka omega_V #> #> 1 1 0.25 2.84 2.78 0.0636 3.73 -0.887 -1.40 0.132 -0.183 #> 2 1 0.57 6.57 5.00 1.57 6.57 0.00239 0.00303 0.132 -0.183 #> 3 1 1.12 10.5 6.80 3.70 8.75 1.75 1.93 0.132 -0.183 #> # ℹ 117 more rows #> # ℹ 10 more variables: omega_Cl , CONC , depot , central , #> # ka , V , Cl , Cc , tad , dosenum "},{"path":"/articles/create-augPred.html","id":"step-3-create-and-plot-an-augmented-prediction","dir":"Articles","previous_headings":"","what":"Step 3: Create and plot an augmented prediction","title":"Created Augmented pred/ipred plots with `augPred()`","text":"","code":"ap <- augPred(fit) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ head(ap) #> values ind id time Endpoint #> 1 0.000000 Individual 1 0.000 depot #> 2 3.726962 Individual 1 0.250 depot #> 3 6.030526 Individual 1 0.493 depot #> 4 6.567601 Individual 1 0.570 depot #> 5 8.414706 Individual 1 0.986 depot #> 6 8.746028 Individual 1 1.120 depot # This augpred looks odd: plot(ap)"},{"path":"/articles/create-office.html","id":"step-1-import-the-model-into-monolix2rx","dir":"Articles","previous_headings":"","what":"Step 1: import the model into monolix2rx","title":"Create PowerPoint and Word documents using monolix2rx","text":"","code":"library(monolix2rx) library(babelmixr2) #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data library(nlmixr2rpt) library(onbrand) library(nonmem2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-office.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Create PowerPoint and Word documents using monolix2rx","text":"can convert model, mod, nlmixr2 fit object: cmt(depot)cmt(central)ka=exp(ka_pop+omega_ka)V=exp(V_pop+omega_V)Cl=exp(Cl_pop+omega_Cl)ddepotdt=−ka×depotdcentraldt=+ka×depot−ClV×centralCc=centralVCONC=CcCONC∼add()+prop(b)+combined1()\\begin{align*} cmt({depot}) \\\\ cmt({central}) \\\\ {ka} & = \\exp\\left({ka\\_pop}+{omega\\_ka}\\right) \\\\ {V} & = \\exp\\left({V\\_pop}+{omega\\_V}\\right) \\\\ {Cl} & = \\exp\\left({Cl\\_pop}+{omega\\_Cl}\\right) \\\\ \\frac{d \\: depot}{dt} & = -{ka} {\\times} {depot} \\\\ \\frac{d \\: central}{dt} & = +{ka} {\\times} {depot}-\\frac{{Cl}}{{V}} {\\times} {central} \\\\ {Cc} & = \\frac{{central}}{{V}} \\\\ {CONC} & = {Cc} \\\\ {CONC} & \\sim add({})+prop({b})+combined1() \\end{align*}","code":"fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit"},{"path":"/articles/create-office.html","id":"step-3-create-a-powerpoint-file","dir":"Articles","previous_headings":"","what":"Step 3: Create a PowerPoint file","title":"Create PowerPoint and Word documents using monolix2rx","text":"PowerPoint can created custom powerpoint templates, example use ones come nlmixr2rpt directly: gives powerpoint ","code":"obnd_pptx = read_template( template = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.pptx\"), mapping = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.yaml\")) obnd_pptx = report_fit( fit = fit, obnd = obnd_pptx) #> #> Attaching package: 'xpose' #> The following object is masked from 'package:stats': #> #> filter #> Registered S3 method overwritten by 'GGally': #> method from #> +.gg ggplot2 #> #> Attaching package: 'ggPMX' #> The following object is masked from 'package:xpose': #> #> get_data #> → Calculating residuals/tables #> ✔ done #> Warning in xpose.nlmixr2::xpose_data_nlmixr(fit): Added CWRES to fit (using #> nlmixr2::addCwres)... #> Skipping table: skip_table (NA found, not generated) #> Skipping figure: res_vs_pred_idv (NA found, not generated) #> Skipping figure: eta_cont (NA found, not generated) #> Skipping figure: eta_cat (NA found, not generated) #> Skipping figure: skip_figure (NA found, not generated) save_report(obnd_pptx, \"mod-PowerPoint.pptx\") #> $isgood #> [1] TRUE #> #> $msgs #> NULL"},{"path":"/articles/create-office.html","id":"step-4-create-a-word-file","dir":"Articles","previous_headings":"","what":"Step 4: Create a Word file","title":"Create PowerPoint and Word documents using monolix2rx","text":"Just like PowerPoint, can customizeown custom word templates, example use ones come nlmixr2rpt directly: gives word document ","code":"obnd_docx = read_template( template = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.docx\"), mapping = system.file(package=\"nlmixr2rpt\", \"templates\",\"nlmixr_obnd_template.yaml\")) obnd_docx = report_fit( fit = fit, obnd = obnd_docx) #> → Calculating residuals/tables #> ✔ done #> Warning in xpose.nlmixr2::xpose_data_nlmixr(fit): Added CWRES to fit (using #> nlmixr2::addCwres)... #> Skipping figure: res_vs_pred_idv (NA found, not generated) #> Skipping figure: skip_figure (NA found, not generated) #> Skipping figure: eta_cont (NA found, not generated) #> Skipping figure: eta_cat (NA found, not generated) save_report(obnd_docx, \"mod-Word.docx\") #> $isgood #> [1] TRUE #> #> $msgs #> NULL"},{"path":"/articles/create-vpc.html","id":"step-1-convert-the-monolix-model-to-rxode2","dir":"Articles","previous_headings":"","what":"Step 1: Convert the Monolix model to rxode2:","title":"Easily Create a VPC using monolix2rx","text":"","code":"library(babelmixr2) #> Loading required package: nlmixr2 #> Loading required package: nlmixr2data library(monolix2rx) # First we need the location of the monolix mlxtran file. Since we are # running an example, we will use one of the built-in examples in # `monolix2rx` pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done"},{"path":"/articles/create-vpc.html","id":"step-2-convert-the-rxode2-model-to-nlmixr2","dir":"Articles","previous_headings":"","what":"Step 2: convert the rxode2 model to nlmixr2","title":"Easily Create a VPC using monolix2rx","text":"can convert model, mod, nlmixr2 fit object:","code":"fit <- as.nlmixr2(mod) #> → loading into symengine environment... #> → pruning branches (`if`/`else`) of full model... #> ✔ done #> → finding duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → optimizing duplicate expressions in EBE model... #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 #> → compiling EBE model... #> ✔ done #> rxode2 3.0.0 using 2 threads (see ?getRxThreads) #> no cache: create with `rxCreateCache()` #> → Calculating residuals/tables #> ✔ done #> → compress origData in nlmixr2 object, save 7168 #> ℹ monolix parameter history integrated into fit object fit #> ── nlmixr² monolix2rx reading Monolix ver 5.1.1 ── #> #> OBJF AIC BIC Log-likelihood Condition#(Cov) #> monolix 118.9368 355.482 377.7819 -169.741 21.26161 #> Condition#(Cor) #> monolix 1.383153 #> #> ── Time (sec fit$time): ── #> #> setup optimize covariance table compress as.nlmixr2 #> elapsed 0.035589 5e-06 6e-06 0.057 0.006 2.236 #> #> ── Population Parameters (fit$parFixed or fit$parFixedDf): ── #> #> Est. SE %RSE Back-transformed(95%CI) BSV(CV%) Shrink(SD)% #> ka_pop 0.427 0.204 47.8 1.53 (1.03, 2.29) 75.4 1.05% #> V_pop -0.786 0.045 5.72 0.456 (0.417, 0.497) 12.7 13.3% #> Cl_pop -3.21 0.0837 2.61 0.0402 (0.0341, 0.0473) 27.6 2.65% #> a 0.433 0.433 #> b 0.0543 0.0543 #> #> Covariance Type (fit$covMethod): monolix2rx #> No correlations in between subject variability (BSV) matrix #> Full BSV covariance (fit$omega) or correlation (fit$omegaR; diagonals=SDs) #> Distribution stats (mean/skewness/kurtosis/p-value) available in fit$shrink #> Censoring (fit$censInformation): No censoring #> Minimization message (fit$message): #> IPRED relative difference compared to Monolix IPRED: 0.04%; 95% percentile: (0%,0.52%); rtol=0.000379 #> PRED relative difference compared to Monolix PRED: 0%; 95% percentile: (0%,0%); rtol=4.94e-07 #> IPRED absolute difference compared to Monolix IPRED: atol=0.00253; 95% percentile: (0.000364, 0.00848) #> PRED absolute difference compared to Monolix PRED: atol=4.94e-07; 95% percentile: (1.13e-08, 0.000308) #> #> ── Fit Data (object fit is a modified tibble): ── #> # A tibble: 120 × 20 #> ID TIME DV PRED RES IPRED IRES IWRES omega_ka omega_V #> #> 1 1 0.25 2.84 2.78 0.0636 3.73 -0.887 -1.40 0.132 -0.183 #> 2 1 0.57 6.57 5.00 1.57 6.57 0.00239 0.00303 0.132 -0.183 #> 3 1 1.12 10.5 6.80 3.70 8.75 1.75 1.93 0.132 -0.183 #> # ℹ 117 more rows #> # ℹ 10 more variables: omega_Cl , CONC , depot , central , #> # ka , V , Cl , Cc , tad , dosenum "},{"path":"/articles/create-vpc.html","id":"step-3-perform-the-vpc","dir":"Articles","previous_headings":"","what":"Step 3: Perform the VPC","title":"Easily Create a VPC using monolix2rx","text":"simply use vpcPlot() conjunction vpc package get regular prediction-corrected VPCs arrange single plot:","code":"library(ggplot2) p1 <- vpcPlot(fit, show=list(obs_dv=TRUE)) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ p1 <- p1 + ylab(\"Concentrations\") + rxode2::rxTheme() + xlab(\"Time (hr)\") + xgxr::xgx_scale_x_time_units(\"hour\", \"hour\") p1a <- p1 + xgxr::xgx_scale_y_log10() ## A prediction-corrected VPC p2 <- vpcPlot(fit, pred_corr = TRUE, show=list(obs_dv=TRUE)) p2 <- p2 + ylab(\"Prediction-Corrected Concentrations\") + rxode2::rxTheme() + xlab(\"Time (hr)\") + xgxr::xgx_scale_x_time_units(\"hour\", \"hour\") p2a <- p2 + xgxr::xgx_scale_y_log10() library(patchwork) (p1 * p1a) / (p2 * p2a) #> Warning in transformation$transform(x): NaNs produced #> Warning in ggplot2::scale_y_log10(..., breaks = breaks, minor_breaks = #> minor_breaks, : log-10 transformation introduced infinite #> values. #> Warning in transformation$transform(x): NaNs produced #> Warning in ggplot2::scale_y_log10(..., breaks = breaks, minor_breaks = #> minor_breaks, : log-10 transformation introduced infinite #> values."},{"path":"/articles/rxode2-validate.html","id":"comparing-differences-between-monolix-and-rxode2","dir":"Articles","previous_headings":"","what":"Comparing differences between Monolix and rxode2","title":"Qualify rxode2 model against Monolix","text":"may wish see differences predictions Monolix rxode2. rxode2 generated outputs compared Monolix generated outputs following items: Population Predictions: shows model translation adequate simulate general trends; validate structural model’s population parameters coupled model structure. Individual Predictions: shows model translation able replicate values subjects within modeling data-set. validates model can reproduce subject variability observed study. Individual Weighted Residuals: one step individual parameter validation, couples individual predictions, observations residual specification generate individual weighted residuals. included consistent nonmem2rx residuals. However, since needed manually adjust residual errors, simply looks errors converted correctly. Note: part validated three metrics subject covariance matrix, omega. assume correct long read correctly.","code":""},{"path":"/articles/rxode2-validate.html","id":"comparing-numerically","dir":"Articles","previous_headings":"","what":"Comparing numerically","title":"Qualify rxode2 model against Monolix","text":"want numerical differences, can also get modified returned ui object. rtol, atol follows : can see exactly match close (say validate). However can explore difference wish looking ipredCompare predCompare datasets: cases can see Monolix seems round values 5 digits, rxode2 keeps everything since solved R directly. Note observation data compared. Dosing predictions excluded comparisons. can also explore Monolix translated input dataset used make validation predictions (dosing observations) $monolixData item:","code":"mod$iwresAtol #> 50% #> 0.003054349 mod$iwresRtol #> 50% #> 0.01526897 mod$ipredAtol #> 50% #> 0.002537436 mod$ipredRtol #> 50% #> 0.0003802867 mod$predAtol #> 50% #> 3.657152e-06 mod$predAtol #> 50% #> 3.657152e-06 head(mod$iwresCompare) #> id time monolixIwres iwres cmt #> 1 1 0.25 -1.397760000 -1.395682322 CONC #> 2 1 0.57 0.000121543 0.003040162 CONC #> 3 1 1.12 1.928970000 1.932039320 CONC #> 4 1 12.12 0.440294000 0.431149277 CONC #> 5 1 2.02 0.196493000 0.198287572 CONC #> 6 1 24.37 0.713742000 0.699508374 CONC head(mod$ipredCompare) #> id time monolixIpred ipred cmt #> 1 1 0.25 3.72839 3.726960 CONC #> 2 1 0.57 6.56990 6.567599 CONC #> 3 1 1.12 8.74855 8.746027 CONC #> 4 1 12.12 5.61508 5.621679 CONC #> 5 1 2.02 9.47386 9.472175 CONC #> 6 1 24.37 2.85999 2.868060 CONC head(mod$predCompare) #> id time monolixPred cmt pred #> 1 1 0.25 2.77640 CONC 2.776402 #> 2 1 0.57 4.99610 CONC 4.996088 #> 3 1 1.12 6.80090 CONC 6.800893 #> 4 1 12.12 3.21554 CONC 3.215548 #> 5 1 2.02 7.41259 CONC 7.412585 #> 6 1 24.37 1.09158 CONC 1.091582 head(mod$monolixData) # with nlme loaded you can also use getData(mod) #> id amt time dv WEIGHT SEX cmt admd #> 1 1 4.02 0.00 NA 79.6 NA NA #> 2 1 NA 0.25 2.84 79.6 NA NA #> 3 1 NA 0.57 6.57 79.6 NA NA #> 4 1 NA 1.12 10.50 79.6 NA NA #> 5 1 NA 2.02 9.66 79.6 NA NA #> 6 1 NA 3.82 8.58 79.6 NA NA"},{"path":"/articles/rxode2-validate.html","id":"comparing-visually","dir":"Articles","previous_headings":"","what":"Comparing visually","title":"Qualify rxode2 model against Monolix","text":"easiest way visually compare differences plot method:","code":"plot(mod) # for general plot # you can also see individual comparisons plot(mod, log=\"y\", ncol=2, nrow=2, xlab=\"Time (hr)\", ylab=\"Concentrations\", page=1) # If you want all pages you could use: # plot(mod, log=\"y\", ncol=2, nrow=2, xlab=\"Time (hr)\", ylab=\"Concentrations\", page=TRUE)"},{"path":"/articles/rxode2-validate.html","id":"notes-on-validation","dir":"Articles","previous_headings":"","what":"Notes on validation","title":"Qualify rxode2 model against Monolix","text":"validation model uses best data available Monolix estimates. : theta population parameters eta individual parameters omega sigma matrices captured. nlmixr2 model fully qualified, IWRES validation ensures residual errors specified correctly. Otherwise omega sigma values contribute validation. Also overall covariance captured, used validation.","code":""},{"path":"/articles/simulate-extra-items.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate Derived Variables from imported Monolix model","text":"","code":"library(monolix2rx) library(rxode2) # First we need the location of the nonmem control stream Since we are running an example, we will use one of the built-in examples in `nonmem2rx` ctlFile <- system.file(\"mods/cpt/runODE032.ctl\", package=\"nonmem2rx\") # You can use a control stream or other file. With the development # version of `babelmixr2`, you can simply point to the listing file # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-extra-items.html","id":"step-2-add-auc-calculation","dir":"Articles","previous_headings":"","what":"Step 2: Add AUC calculation","title":"Simulate Derived Variables from imported Monolix model","text":"concentration case Cc model, trick get AUC additional ODE d/dt(AUC) <- Cc use reset get per dosing period. However, additional parameter part original model. calculation AUC depend number observations model, sparse data wouldn’t terribly accurate. One thing can use model piping append d/dt(AUC) <- Cc imported model: can also use append=NA pre-pend append=f put ODE right f line model.","code":"modAuc <- mod %>% model(d/dt(AUC) <- Cc, append=TRUE) #> → significant model change detected #> → kept in model: '$monolixData' #> → removed from model: '$admd', '$etaData', '$ipredAtol', '$ipredCompare', '$ipredRtol', '$iwresAtol', '$iwresCompare', '$iwresRtol', '$mlxtran', '$predAtol', '$predCompare', '$predIpredData', '$predRtol' modAuc #> ── rxode2-based free-form 3-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> 3 3 AUC #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> d/dt(AUC) <- Cc #> }) #> }"},{"path":"/articles/simulate-extra-items.html","id":"step-3-setup-event-table-to-calculate-the-auc-for-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 3: Setup event table to calculate the AUC for a different dosing paradigm:","title":"Simulate Derived Variables from imported Monolix model","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table. case since also wanting AUC per dosing period, can add reset dose AUC compartment every time dose given (track AUC current dose):","code":"ev <- et(amt=4, ii=12, until=24) %>% et(amt=0, ii=12, until=24, cmt=\"AUC\", evid=5) %>% # replace AUC with zero at dosing et(c(0, 4, 8, 11.999, 12, 12.01, 14, 20, 23.999, 24, 24.001, 28, 32, 36)) %>% et(id=1:10)"},{"path":"/articles/simulate-extra-items.html","id":"step-4-solve-using-rxode2","dir":"Articles","previous_headings":"","what":"Step 4: Solve using rxode2","title":"Simulate Derived Variables from imported Monolix model","text":"step, solve model new event table 10 subjects: Note since derived nonmem2rx model, default solving match tolerances methods specified NONMEM model.","code":"s <- rxSolve(modAuc, ev) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"/articles/simulate-extra-items.html","id":"step-5-exploring-the-simulation-by-plotting-and-summarizing-dplyr","dir":"Articles","previous_headings":"","what":"Step 5: Exploring the simulation (by plotting), and summarizing (dplyr)","title":"Simulate Derived Variables from imported Monolix model","text":"solved object acts rxode2 solved object, can use plot() function see individual running AUC profiles simulated: can also select points near dosing get AUC interval:","code":"library(ggplot2) plot(s, AUC) + ylab(\"Running AUC\") library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:data.table': #> #> between, first, last #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union s %>% filter(time %in% c(11.999, 23.999)) %>% mutate(time=round(time)) %>% select(id, time, AUC) #> id time AUC #> 1 1 12 71.67319 #> 2 1 24 102.46378 #> 3 2 12 62.73231 #> 4 2 24 91.10876 #> 5 3 12 62.42782 #> 6 3 24 86.37406 #> 7 4 12 44.99681 #> 8 4 24 59.71716 #> 9 5 12 58.29805 #> 10 5 24 81.99565 #> 11 6 12 51.33952 #> 12 6 24 66.40563 #> 13 7 12 71.35170 #> 14 7 24 95.19523 #> 15 8 12 57.10391 #> 16 8 24 81.70183 #> 17 9 12 51.23582 #> 18 9 24 67.72999 #> 19 10 12 45.90700 #> 20 10 24 61.53054"},{"path":"/articles/simulate-new-dosing.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate New dosing from Monolix model","text":"","code":"library(monolix2rx) library(rxode2) # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-new-dosing.html","id":"step-2-look-at-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 2: Look at a different dosing paradigm","title":"Simulate New dosing from Monolix model","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table:","code":"ev <- et(amt=4, ii=12, until=24) %>% et(list(c(0, 2), # add observations in windows c(4, 6), c(8, 12), c(14, 18), c(20, 26), c(28, 32), c(32, 36), c(36, 44))) %>% et(id=1:10)"},{"path":"/articles/simulate-new-dosing.html","id":"step-3-solve-using-rxode2","dir":"Articles","previous_headings":"","what":"Step 3: solve using rxode2","title":"Simulate New dosing from Monolix model","text":"step, solve model new event table 10 subjects: Note since nonmem2rx model, default solving match tolerances methods specified NONMEM model.","code":"s <- rxSolve(mod, ev) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’"},{"path":"/articles/simulate-new-dosing.html","id":"step-4-exploring-the-simulation-by-plotting","dir":"Articles","previous_headings":"","what":"Step 4: exploring the simulation (by plotting)","title":"Simulate New dosing from Monolix model","text":"solved object acts rxode2 solved object, can use plot() function see individual profiles simulated:","code":"library(ggplot2) plot(s, ipredSim) + ylab(\"Concentrations\")"},{"path":"/articles/simulate-uncertainty.html","id":"step-1-import-the-model","dir":"Articles","previous_headings":"","what":"Step 1: Import the model","title":"Simulate using Parameter Uncertainty","text":"","code":"library(monolix2rx) library(rxode2) # its best practice to set the seed for the simulations set.seed(42) rxSetSeed(42) # You use the path to the monolix mlxtran file # In this case we will us the theophylline project included in monolix2rx pkgTheo <- system.file(\"theo/theophylline_project.mlxtran\", package=\"monolix2rx\") # Note you have to setup monolix2rx to use the model library or save # the model as a separate file mod <- monolix2rx(pkgTheo) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning in .dataRenameFromMlxtran(data, .mlxtran): NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done print(mod) #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop ~ 0.09785 #> V_pop ~ c(0.00082606, 0.00041937) #> Cl_pop ~ c(-4.2833e-05, -6.7957e-06, 1.1318e-05) #> omega_ka ~ c(omega_ka = 0.022259) #> omega_V ~ c(omega_ka = -7.6443e-05, omega_V = 0.0014578) #> omega_Cl ~ c(omega_ka = 3.062e-06, omega_V = -1.2912e-05, #> omega_Cl = 0.0039578) #> a ~ c(omega_ka = -0.0001227, omega_V = -6.5914e-05, omega_Cl = -0.00041194, #> a = 0.015333) #> b ~ c(omega_ka = -1.3886e-05, omega_V = -3.1105e-05, #> omega_Cl = 5.2805e-05, a = -0.0026458, b = 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/articles/simulate-uncertainty.html","id":"step-2-look-at-a-different-dosing-paradigm","dir":"Articles","previous_headings":"","what":"Step 2: Look at a different dosing paradigm","title":"Simulate using Parameter Uncertainty","text":"Lets say case instead single dose, want see concentration profile single day BID dosing. case done creating quick event table.","code":"ev <- et(amt=4, ii=12, until=24) %>% et(c(1:6, seq(8, 24, by=2))) %>% et(id=1:100)"},{"path":"/articles/simulate-uncertainty.html","id":"step-3-solve-using-the-uncertainty-in-the-nonmem-model","dir":"Articles","previous_headings":"","what":"Step 3: Solve using the uncertainty in the NONMEM model","title":"Simulate using Parameter Uncertainty","text":"use uncertainty model, simple matter telling many times rxode2() sample nStud=X. case use 100.","code":"s <- rxSolve(mod, ev, nStud=100) #> ℹ using locf interpolation like Monolix, specify directly to change #> ℹ using dfSub=12 from Monolix #> ℹ using dfObs=120 from Monolix #> ℹ using thetaMat from Monolix #> ℹ using Monolix specified atol=1e-06 #> ℹ using Monolix specified rtol=1e-06 #> ℹ Since Monolix doesn't use ssRtol, set ssRtol=100 #> ℹ Since Monolix doesn't use ssRtol, set ssAtol=100 #> ℹ Since Monolix uses a set number of doses for steady state use maxSS=8, minSS=7 #> [====|====|====|====|====|====|====|====|====|====] 0:00:00 s #> ── Solved rxode2 object ── #> ── Parameters (x$params): ── #> # A tibble: 10,000 × 10 #> sim.id id ka_pop V_pop Cl_pop a b omega_ka omega_V omega_Cl #> #> 1 1 1 0.281 -0.770 -3.22 0.475 0.0653 0.470 -0.208 0.483 #> 2 1 2 0.281 -0.770 -3.22 0.475 0.0653 0.654 0.0861 0.129 #> 3 1 3 0.281 -0.770 -3.22 0.475 0.0653 -0.0747 0.168 0.500 #> 4 1 4 0.281 -0.770 -3.22 0.475 0.0653 0.126 -0.0226 0.479 #> 5 1 5 0.281 -0.770 -3.22 0.475 0.0653 -0.162 0.000264 -0.205 #> 6 1 6 0.281 -0.770 -3.22 0.475 0.0653 -1.13 -0.239 0.0941 #> 7 1 7 0.281 -0.770 -3.22 0.475 0.0653 -0.335 0.0134 0.00490 #> 8 1 8 0.281 -0.770 -3.22 0.475 0.0653 -0.869 -0.239 0.000511 #> 9 1 9 0.281 -0.770 -3.22 0.475 0.0653 1.35 -0.122 0.667 #> 10 1 10 0.281 -0.770 -3.22 0.475 0.0653 0.314 0.0494 -0.552 #> # ℹ 9,990 more rows #> ── Initial Conditions (x$inits): ── #> depot central #> 0 0 #> #> Simulation with uncertainty in: #> • parameters (x$thetaMat for changes) #> • omega matrix (x$omegaList) #> • sigma matrix (x$sigmaList) #> #> ── First part of data (object): ── #> # A tibble: 150,000 × 12 #> sim.id id time ka V Cl Cc CONC ipredSim sim depot #> #> 1 1 1 1 2.12 0.376 0.0646 8.36 8.36 8.36 8.50 0.481 #> 2 1 1 2 2.12 0.376 0.0646 8.04 8.04 8.04 9.71 0.0577 #> 3 1 1 3 2.12 0.376 0.0646 6.90 6.90 6.90 7.77 0.00694 #> 4 1 1 4 2.12 0.376 0.0646 5.82 5.82 5.82 5.07 0.000833 #> 5 1 1 5 2.12 0.376 0.0646 4.91 4.91 4.91 4.91 0.000100 #> 6 1 1 6 2.12 0.376 0.0646 4.13 4.13 4.13 3.79 0.0000121 #> # ℹ 149,994 more rows #> # ℹ 1 more variable: central "},{"path":"/articles/simulate-uncertainty.html","id":"step-4-summarize-and-plot","dir":"Articles","previous_headings":"","what":"Step 4: Summarize and plot","title":"Simulate using Parameter Uncertainty","text":"Since bunch data, confidence band simulation uncertainty helpful. One way select interesting components, create confidence interval plot confidence bands:","code":"sci <- confint(s, parm=c(\"CONC\", \"sim\")) #> summarizing data...done sci #> # A tibble: 90 × 7 #> p1 time trt p2.5 p50 p97.5 Percentile #> #> 1 0.0250 1 CONC 0.741 2.40 4.39 2.5% #> 2 0.5 1 CONC 4.21 6.21 7.25 50% #> 3 0.975 1 CONC 7.89 9.32 11.1 97.5% #> 4 0.0250 2 CONC 1.33 3.80 5.59 2.5% #> 5 0.5 2 CONC 5.76 6.94 7.45 50% #> 6 0.975 2 CONC 8.22 9.14 10.6 97.5% #> 7 0.0250 3 CONC 1.79 4.36 5.42 2.5% #> 8 0.5 3 CONC 6.04 6.66 7.05 50% #> 9 0.975 3 CONC 7.79 8.71 9.99 97.5% #> 10 0.0250 4 CONC 2.12 4.36 5.26 2.5% #> # ℹ 80 more rows p1 <- plot(sci) p2 <- plot(sci, log=\"y\") library(patchwork) p1/p2"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Matthew Fidler. Author, maintainer. Justin Wilkins. Contributor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Fidler M (2024). monolix2rx: 'monolix2rx' Converts 'Monolix' Models 'rxode2'. R package version 0.0.1.","code":"@Manual{, title = {monolix2rx: 'monolix2rx' Converts 'Monolix' Models to 'rxode2'}, author = {Matthew Fidler}, year = {2024}, note = {R package version 0.0.1}, }"},{"path":"/index.html","id":"monolix2rx-","dir":"","previous_headings":"","what":"monolix2rx Converts Monolix Models to rxode2","title":"monolix2rx Converts Monolix Models to rxode2","text":"goal monolix2rx convert Monolix rxode2 use simulation sharing model open-source framework.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"monolix2rx Converts Monolix Models to rxode2","text":"can install development version monolix2rx GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"nlmixr2/monolix2rx\")"},{"path":"/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"monolix2rx Converts Monolix Models to rxode2","text":"trying convert Monolix rxode2 model simply need path mlxtran file. example, classic demo theophylline included monolix2rx can imported :","code":"library(monolix2rx) # First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # file as a text file (hence you can access without model library). # Additionally some of the file paths were shortened so they could # be included with monolix2rx pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mlxtranFile <- file.path(pkgTheo, \"theophylline_project.mlxtran\") rx <- monolix2rx(mlxtranFile) #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done rx #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> ka_pop V_pop Cl_pop a b #> 0.42699448 -0.78635157 -3.21457598 0.43327956 0.05425953 #> #> Omega ($omega): #> omega_ka omega_V omega_Cl #> omega_ka 0.4503145 0.00000000 0.00000000 #> omega_V 0.0000000 0.01594701 0.00000000 #> omega_Cl 0.0000000 0.00000000 0.07323701 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level #> 1 ka_pop omega_ka id #> 2 V_pop omega_V id #> 3 Cl_pop omega_Cl id #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\\nThis has been modified so that it will run without the model library\" #> dfObs <- 120 #> dfSub <- 12 #> thetaMat <- lotri({ #> ka_pop + V_pop + Cl_pop ~ c(0.09785, 0.00082606, 0.00041937, #> -4.2833e-05, -6.7957e-06, 1.1318e-05) #> a + b ~ c(0.015333, -0.0026458, 0.00056232) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.04%; 95% percentile: (0%,0.52%); rtol=0.00038\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (0.000362, 0.00848); atol=0.00254\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=6.6e-07\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.6e-07, 1.27e-05); atol=3.66e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.06%,32.22%); rtol=0.0153\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.000403, 0.0138); atol=0.00305\") #> ini({ #> ka_pop <- 0.426994483535611 #> V_pop <- -0.786351566327091 #> Cl_pop <- -3.21457597916301 #> a <- c(0, 0.433279557549051) #> b <- c(0, 0.0542595276206251) #> omega_ka ~ 0.450314511978718 #> omega_V ~ 0.0159470121255372 #> omega_Cl ~ 0.0732370098834837 #> }) #> model({ #> cmt(depot) #> cmt(central) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + omega_V) #> Cl <- exp(Cl_pop + omega_Cl) #> d/dt(depot) <- -ka * depot #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> CONC <- Cc #> CONC ~ add(a) + prop(b) + combined1() #> }) #> } # If you are only interseted in the parsing you can use `mlxtran` mlx <- mlxtran(mlxtranFile) #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done mlx #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [FILEINFO] #> ; parsed: $DATAFILE$FILEINFO$FILEINFO #> file = 'data/theophylline_data.txt' #> delimiter = tab #> header = {ID, AMT, TIME, CONC, WEIGHT, SEX} #> #> [CONTENT] #> ; parsed: $DATAFILE$CONTENT$CONTENT #> ID = {use=identifier} #> TIME = {use=time} #> AMT = {use=amount} #> CONC = {use=observation, name=CONC, type=continuous} #> WEIGHT = {use=covariate, type=continuous} #> SEX = {use=covariate, type=categorical} #> #> #> [INDIVIDUAL] #> ; parsed: $MODEL$INDIVIDUAL$INDIVIDUAL #> input = {ka_pop, omega_ka, V_pop, omega_V, Cl_pop, omega_Cl} #> #> DEFINITION: #> ; parsed: $MODEL$INDIVIDUAL$DEFINITION #> ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} #> V = {distribution=lognormal, typical=V_pop, sd=omega_V} #> Cl = {distribution=lognormal, typical=Cl_pop, sd=omega_Cl} #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {a, b, ka, V, Cl} #> file = 'oral1_1cpt_kaVCl.txt' #> #> DEFINITION: #> ; parsed: $MODEL$LONGITUDINAL$DEFINITION #> CONC = {distribution=normal, prediction=Cc, errorModel=combined1(a, b)} #> #> EQUATION: #> #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc #> #> #> ; parsed: $FIT$FIT #> data = {CONC} #> model = {CONC} #> #> #> ; parsed: $PARAMETER$PARAMETER #> Cl_pop = {value=0.1, method=MLE} #> V_pop = {value=0.5, method=MLE} #> a = {value=1, method=MLE} #> b = {value=0.3, method=MLE} #> ka_pop = {value=1, method=MLE} #> omega_Cl = {value=1, method=MLE} #> omega_V = {value=1, method=MLE} #> omega_ka = {value=1, method=MLE} #> #> #> [TASKS] #> ; parsed: $MONOLIX$TASKS$TASKS #> populationParameters() #> individualParameters(method = {conditionalMean, conditionalMode}) #> fim(method = Linearization) #> logLikelihood(method = Linearization) #> plotResult(method = {indfits, obspred, vpc, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) #> #> [SETTINGS] #> GLOBAL: #> ; parsed: $MONOLIX$SETTINGS$GLOBAL #> exportpath = 'tp' #> #> ; unparsed sections: #> ; $MODEL$LONGITUDINAL$EQUATION # this can be converted to a list mlx <- as.list(mlx) mlx$DATAFILE$FILEINFO$FILEINFO #> $file #> [1] \"data/theophylline_data.txt\" #> #> $header #> [1] \"ID\" \"AMT\" \"TIME\" \"CONC\" \"WEIGHT\" \"SEX\" #> #> $delimiter #> [1] \"tab\""},{"path":"/index.html","id":"translating-models-from-the-monolix-model-library","dir":"","previous_headings":"","what":"Translating models from the Monolix model library","title":"monolix2rx Converts Monolix Models to rxode2","text":"models using Monolix’s model library, models may accessible text files versions Monolix. mlxtran files may see something like: older versions Monolix, model libraries group text files. can find looking file Monolix library like bolus_1cpt_TlagVCl.txt. case pk/bolus_1cpt_TlagVCl.txt. parent directory model library. access files (even old version Monolix) can make monolix2rx aware model library using: Unix, can symbolic link whatever model library like use. can check see works trying translate model file rxode2: computer setup correctly (like ) see translated model. Note since isn’t mlxtran file relationship population parameters, subject variability etc initial parameter estimates model. model library setup correctly see found old model library get: newer versions Monolix, model library turned binary database accessed GUI lixoftConnectors. lixoftConnectors system can successfully load model lixoftConnectors::getLibraryModelContent() monolix2rx also load model correctly (use version text files setup) means need import models rxode2 need : model built model library need: path text file Monolix Library setup monolix2rx.library options(monolix2rx.library=\"~/src/monolix/library/\") lixoftConnectors installed connected newer (licensed) version Monolix can get model library content lixoftConnectors::getLibraryModelContent() without options, need save model text file outside model library can import model.","code":"lib:bolus_1cpt_TlagVCl.txt # If the model library was located in ~/src/monolix/library # Then you would set the model library up as follows: options(monolix2rx.library=\"~/src/monolix/library/\") monolix2rx(\"lib:bolus_1cpt_TlagVCl.txt\") #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ cannot find individual parameter estimates #> ── rxode2-based free-form 1-cmt ODE model ────────────────────────────────────── #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 central #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is via a bolus with a lag time (Tlag).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\" #> model({ #> cmt(central) #> d/dt(central) <- -Cl/V * central #> alag(central) <- Tlag #> Cc <- central/V #> }) #> } try(monolix2rx(\"lib:notThere.txt\")) #> Warning in .mlxtranLib(file): while options('monolix2rx.library') is set, could not find model file 'lib:notThere.txt' #> please save the model to translate #> Error : could not find the model file"},{"path":"/index.html","id":"note-on-testing","dir":"","previous_headings":"","what":"Note on testing","title":"monolix2rx Converts Monolix Models to rxode2","text":"tests package include testing Monolix demo files, Monolix library files (available), Monolix validation suite. Since part Monolix , included package. can setup monolix2rx run tests files well setting options:","code":"# setup monolix library (and will test that the parsing and translation are as expected) options(monolix2rx.library=\"~/src/monolix/library/\") # setup monolix demos to be tested options(monolix2rx.demo=\"~/src/monolix/demos/\")"},{"path":"/reference/autoplot.monolix2rx.html","id":null,"dir":"Reference","previous_headings":"","what":"Autoplot monolix2rx object — autoplot.monolix2rx","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"Autoplot monolix2rx object","code":""},{"path":"/reference/autoplot.monolix2rx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"","code":"# S3 method for class 'monolix2rx' autoplot( object, ..., ncol = 3, nrow = 3, log = \"\", xlab = \"Time\", ylab = \"Predictions\", page = FALSE )"},{"path":"/reference/autoplot.monolix2rx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"object object, whose class determine behaviour autoplot ... ignored parameters monolix2rx objects nrow, ncol Number rows columns log \"\" (neither x y), \"x\", \"y\", \"xy\" (\"yx\") log-scale? xlab, ylab x y axis labels page number page(s) individual plots, default (FALSE) pages print; can use TRUE pages print, list pages want print","code":""},{"path":"/reference/autoplot.monolix2rx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Autoplot monolix2rx object — autoplot.monolix2rx","text":"ggplot2 object","code":""},{"path":"/reference/dot-getNbdoses.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of doses for steady state for monolix2rx — .getNbdoses","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Get number doses steady state monolix2rx","code":""},{"path":"/reference/dot-getNbdoses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"","code":".getNbdoses(x)"},{"path":"/reference/dot-getNbdoses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"x monolix2rx object","code":""},{"path":"/reference/dot-getNbdoses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Number doses monolix2rx object","code":""},{"path":"/reference/dot-getNbdoses.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the number of doses for steady state for monolix2rx — .getNbdoses","text":"Matthew L. Fidler","code":""},{"path":"/reference/dot-getStiff.html","id":null,"dir":"Reference","previous_headings":"","what":"Get if the model object is stiff — .getStiff","title":"Get if the model object is stiff — .getStiff","text":"Get model object stiff","code":""},{"path":"/reference/dot-getStiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get if the model object is stiff — .getStiff","text":"","code":".getStiff(x)"},{"path":"/reference/dot-getStiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get if the model object is stiff — .getStiff","text":"x monolix2rx object","code":""},{"path":"/reference/dot-getStiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get if the model object is stiff — .getStiff","text":"boolean indicating object stiff system (indicated monolix)","code":""},{"path":"/reference/dot-getStiff.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get if the model object is stiff — .getStiff","text":"Matthew L. Fidler","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"Get best mlxtran info return NULL","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"","code":".monolixGetMlxtran(x)"},{"path":"/reference/dot-monolixGetMlxtran.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"x item try extract mlxtran info","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"mlxtran info","code":""},{"path":"/reference/dot-monolixGetMlxtran.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the best mlxtran info or return NULL — .monolixGetMlxtran","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxTxt.html","id":null,"dir":"Reference","previous_headings":"","what":"Get equation block from a Monolix model txt file — mlxTxt","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"Get equation block Monolix model txt file","code":""},{"path":"/reference/mlxTxt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"","code":"mlxTxt(file, retFile = FALSE)"},{"path":"/reference/mlxTxt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"file string representing model text file. Can lib:fileName.txt library setup/available retFile boolean tells mlxTxt() return file name instead error file exist","code":""},{"path":"/reference/mlxTxt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"parsed equation file name","code":""},{"path":"/reference/mlxTxt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxTxt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get equation block from a Monolix model txt file — mlxTxt","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mod <- mlxTxt(file.path(pkgTheo, \"oral1_1cpt_kaVCl.txt\")) mod #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {ka, V, Cl} #> #> EQUATION: #> ; parsed: $MODEL$LONGITUDINAL$EQUATION #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc"},{"path":"/reference/mlxtran.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and parse mlxtran lines — mlxtran","title":"Read and parse mlxtran lines — mlxtran","text":"Read parse mlxtran lines","code":""},{"path":"/reference/mlxtran.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and parse mlxtran lines — mlxtran","text":"","code":"mlxtran(file, equation = FALSE, update = FALSE)"},{"path":"/reference/mlxtran.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and parse mlxtran lines — mlxtran","text":"file mlxtran file process equation parse equation block rxode2 (models translated) update true, try update parameter block final parameter estimates","code":""},{"path":"/reference/mlxtran.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and parse mlxtran lines — mlxtran","text":"mlxtran object","code":""},{"path":"/reference/mlxtran.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read and parse mlxtran lines — mlxtran","text":"Matthew L. Fidler","code":""},{"path":"/reference/mlxtran.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and parse mlxtran lines — mlxtran","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") mlx <- mlxtran(file.path(pkgTheo, \"theophylline_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done mlx #> DESCRIPTION: #> The administration is extravascular with a first order absorption (rate constant ka). #> The PK model has one compartment (volume V) and a linear elimination (clearance Cl). #> This has been modified so that it will run without the model library #> #> #> [FILEINFO] #> ; parsed: $DATAFILE$FILEINFO$FILEINFO #> file = 'data/theophylline_data.txt' #> delimiter = tab #> header = {ID, AMT, TIME, CONC, WEIGHT, SEX} #> #> [CONTENT] #> ; parsed: $DATAFILE$CONTENT$CONTENT #> ID = {use=identifier} #> TIME = {use=time} #> AMT = {use=amount} #> CONC = {use=observation, name=CONC, type=continuous} #> WEIGHT = {use=covariate, type=continuous} #> SEX = {use=covariate, type=categorical} #> #> #> [INDIVIDUAL] #> ; parsed: $MODEL$INDIVIDUAL$INDIVIDUAL #> input = {ka_pop, omega_ka, V_pop, omega_V, Cl_pop, omega_Cl} #> #> DEFINITION: #> ; parsed: $MODEL$INDIVIDUAL$DEFINITION #> ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} #> V = {distribution=lognormal, typical=V_pop, sd=omega_V} #> Cl = {distribution=lognormal, typical=Cl_pop, sd=omega_Cl} #> #> [LONGITUDINAL] #> ; parsed: $MODEL$LONGITUDINAL$LONGITUDINAL #> input = {a, b, ka, V, Cl} #> #> DEFINITION: #> ; parsed: $MODEL$LONGITUDINAL$DEFINITION #> CONC = {distribution=normal, prediction=Cc, errorModel=combined1(a, b)} #> #> EQUATION: #> #> ; PK model definition #> Cc = pkmodel(ka, V, Cl) #> #> OUTPUT: #> ; parsed: $MODEL$LONGITUDINAL$OUTPUT #> output = Cc #> #> #> ; parsed: $FIT$FIT #> data = {CONC} #> model = {CONC} #> #> #> ; parsed: $PARAMETER$PARAMETER #> Cl_pop = {value=0.1, method=MLE} #> V_pop = {value=0.5, method=MLE} #> a = {value=1, method=MLE} #> b = {value=0.3, method=MLE} #> ka_pop = {value=1, method=MLE} #> omega_Cl = {value=1, method=MLE} #> omega_V = {value=1, method=MLE} #> omega_ka = {value=1, method=MLE} #> #> #> [TASKS] #> ; parsed: $MONOLIX$TASKS$TASKS #> populationParameters() #> individualParameters(method = {conditionalMean, conditionalMode}) #> fim(method = Linearization) #> logLikelihood(method = Linearization) #> plotResult(method = {indfits, obspred, vpc, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) #> #> [SETTINGS] #> GLOBAL: #> ; parsed: $MONOLIX$SETTINGS$GLOBAL #> exportpath = 'tp' #> #> ; unparsed sections: #> ; $MODEL$LONGITUDINAL$EQUATION"},{"path":"/reference/monolix2rx.html","id":null,"dir":"Reference","previous_headings":"","what":"Translate a monolix file to rxode2 — monolix2rx","title":"Translate a monolix file to rxode2 — monolix2rx","text":"Translate monolix file rxode2","code":""},{"path":"/reference/monolix2rx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Translate a monolix file to rxode2 — monolix2rx","text":"","code":"monolix2rx( mlxtran, update = TRUE, thetaMatType = c(\"sa\", \"lin\"), sd = 1, cor = 1e-05, theta = 0.5, ci = 0.95, sigdig = 3, envir = parent.frame() )"},{"path":"/reference/monolix2rx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Translate a monolix file to rxode2 — monolix2rx","text":"mlxtran file name mlxtran translate rxode2 update boolean represents final parameter estimates used translation (present) thetaMatType lists preferred source thetaMat covariance matrix. default sa simulated annealing, though use lin linearized covariance calculation. one present, use whatever present sd Default standard deviation subject variability/inter-occasion variability missing. cor Default correlation missing correlations estimate theta default population estimate ci confidence interval validation, default 0.95 sigdig number significant digits validation, default 3 envir represents environment used evaluating corresponding rxode2 function","code":""},{"path":"/reference/monolix2rx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Translate a monolix file to rxode2 — monolix2rx","text":"rxode2 model","code":""},{"path":"/reference/monolix2rx.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Translate a monolix file to rxode2 — monolix2rx","text":"Matthew L. Fidler","code":""},{"path":"/reference/monolix2rx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Translate a monolix file to rxode2 — monolix2rx","text":"","code":"# First load in the model; in this case the theo model # This is modified from the Monolix demos by saving the model # File as a text file (hence you can access without model library) # setup. # # This example is also included in the monolix2rx package, so # you refer to the location with `system.file()`: pkgTheo <- system.file(\"theo\", package=\"monolix2rx\") rx <- monolix2rx(file.path(pkgTheo, \"theophylline_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_kaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesLin.txt #> ℹ done #> Warning: NAs introduced by coercion #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> #> #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done pkgCov <- system.file(\"cov\", package=\"monolix2rx\") rx <- monolix2rx(file.path(pkgCov, \"warfarin_covariate3_project.mlxtran\")) #> ℹ integrated model file 'oral1_1cpt_TlagkaVCl.txt' into mlxtran object #> ℹ updating model values to final parameter estimates #> ℹ done #> ℹ reading run info (# obs, doses, Monolix Version, etc) from summary.txt #> ℹ done #> ℹ reading covariance from FisherInformation/covarianceEstimatesSA.txt #> ℹ done #> ℹ imported monolix and translated to rxode2 compatible data ($monolixData) #> ℹ imported monolix ETAS (_SAEM) imported to rxode2 compatible data ($etaData) #> ℹ imported monolix pred/ipred data to compare ($predIpredData) #> #> #> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’ #> ℹ solving ipred problem #> ℹ done #> ℹ solving pred problem #> ℹ done rx #> ── rxode2-based free-form 2-cmt ODE model ────────────────────────────────────── #> ── Initalization: ── #> Fixed Effects ($theta): #> Tlag_pop ka_pop V_pop Cl_pop beta_V_tSex_F #> -0.25949800 0.35610590 2.13606937 -2.00665359 -0.38227857 #> beta_Cl_tSex_F a b #> -0.09383651 0.24818991 0.05086658 #> #> Omega ($omega): #> omega_Tlag omega_ka omega_V omega_Cl #> omega_Tlag 0.3836648 0.0000000 0.00000000 0.00000000 #> omega_ka 0.0000000 0.9857194 0.00000000 0.00000000 #> omega_V 0.0000000 0.0000000 0.02782834 0.00000000 #> omega_Cl 0.0000000 0.0000000 0.00000000 0.08142194 #> #> States ($state or $stateDf): #> Compartment Number Compartment Name #> 1 1 depot #> 2 2 central #> ── μ-referencing ($muRefTable): ── #> theta eta level covariates #> 1 Tlag_pop omega_Tlag id #> 2 ka_pop omega_ka id #> 3 V_pop omega_V id (tSex == \"F\")*beta_V_tSex_F #> 4 Cl_pop omega_Cl id (tSex == \"F\")*beta_Cl_tSex_F #> #> ── Model (Normalized Syntax): ── #> function() { #> description <- \"The administration is extravascular with a first order absorption (rate constant ka) and a lag time (Tlag).\\nThe PK model has one compartment (volume V) and a linear elimination (clearance Cl).\" #> dfObs <- 479 #> dfSub <- 32 #> thetaMat <- lotri({ #> Tlag_pop ~ c(Tlag_pop = 0.0695270111760315) #> ka_pop ~ c(Tlag_pop = 0.00420093609313868, ka_pop = 0.195044017895198) #> V_pop ~ c(Tlag_pop = -1.96027567180685e-05, ka_pop = -0.00923639238851991, #> V_pop = 0.0894995626339569) #> beta_V_tSex_F ~ c(Tlag_pop = 0.000672864307227817, ka_pop = 0.00146099695978716, #> V_pop = -0.0105938787089785, beta_V_tSex_F = 0.00724034) #> Cl_pop ~ c(Tlag_pop = 3.33517518294536e-05, ka_pop = -0.000198349948605509, #> V_pop = 1.64480523051151e-05, beta_V_tSex_F = -2.52790128781238e-06, #> Cl_pop = 5.67721912406063e-05) #> beta_Cl_tSex_F ~ c(Tlag_pop = 4.97719167561125e-05, ka_pop = 0.00116960996255074, #> V_pop = -0.000127036295934593, beta_V_tSex_F = -1.29385e-06, #> Cl_pop = -0.000421700477175592, beta_Cl_tSex_F = 0.0199246) #> omega_Tlag ~ c(Tlag_pop = -0.0670860109353223, ka_pop = 0.00570893614027221, #> V_pop = 0.00299407684209903, beta_V_tSex_F = -0.00119581, #> Cl_pop = 2.03533460988456e-06, beta_Cl_tSex_F = -0.00034514, #> omega_Tlag = 0.116943) #> omega_ka ~ c(Tlag_pop = -0.0133385617208073, ka_pop = 0.0172356179141179, #> V_pop = 0.00171771988746332, beta_V_tSex_F = -0.000442385, #> Cl_pop = 7.3966470999696e-05, beta_Cl_tSex_F = -0.000725679, #> omega_Tlag = 0.0139898, omega_ka = 0.0694802) #> omega_V ~ c(Tlag_pop = -0.000154212149163577, ka_pop = 0.000300664573505569, #> V_pop = 4.67557030887738e-05, beta_V_tSex_F = -1.72411e-06, #> Cl_pop = -2.66907442804329e-06, beta_Cl_tSex_F = 2.11319e-05, #> omega_Tlag = 0.000296489, omega_ka = -0.000253742, #> omega_V = 0.000656055) #> omega_Cl ~ c(Tlag_pop = -0.00020876675474306, ka_pop = 0.000203991029463676, #> V_pop = -4.25014903301396e-05, beta_V_tSex_F = 1.01086e-05, #> Cl_pop = -4.27528356071897e-07, beta_Cl_tSex_F = -3.1184e-05, #> omega_Tlag = 0.000190543, omega_ka = -0.000195656, #> omega_V = 3.1147e-06, omega_Cl = 0.00133407) #> a ~ c(Tlag_pop = 0.000459922525965396, ka_pop = -0.000402122537073151, #> V_pop = -0.00035759769526248, beta_V_tSex_F = -5.67417e-07, #> Cl_pop = 4.93306085861609e-06, beta_Cl_tSex_F = 5.18592e-05, #> omega_Tlag = -0.000767474, omega_ka = -0.000402704, #> omega_V = -3.56563e-05, omega_Cl = 5.77815e-05, a = 0.00146135) #> b ~ c(Tlag_pop = -4.42123891106805e-05, ka_pop = 6.74134848256571e-05, #> V_pop = 0.000102247569651447, beta_V_tSex_F = -4.84525e-06, #> Cl_pop = -7.84308816660971e-07, beta_Cl_tSex_F = -4.64896e-06, #> omega_Tlag = 5.67197e-05, omega_ka = 4.06959e-05, #> omega_V = -4.39519e-06, omega_Cl = -1.31481e-05, #> a = -0.000214637, b = 5.66332e-05) #> }) #> validation <- c(\"ipred relative difference compared to Monolix ipred: 0.39%; 95% percentile: (0.02%,3.18%); rtol=0.00394\", #> \"ipred absolute difference compared to Monolix ipred: 95% percentile: (8.49e-05, 0.166); atol=0.0175\", #> \"pred relative difference compared to Monolix pred: 0%; 95% percentile: (0%,0%); rtol=1.21e-06\", #> \"pred absolute difference compared to Monolix pred: 95% percentile: (1.87e-08, 4.92e-05); atol=6.07e-06\", #> \"iwres relative difference compared to Monolix iwres: 0%; 95% percentile: (0.24%,204.01%); rtol=0.0794\", #> \"iwres absolute difference compared to Monolix pred: 95% percentile: (0.0026, 0.33); atol=0.0362\") #> ini({ #> Tlag_pop <- -0.259498000083172 #> ka_pop <- 0.356105897545116 #> V_pop <- 2.1360693683596 #> Cl_pop <- -2.00665359474148 #> beta_V_tSex_F <- -0.382278567256413 #> beta_Cl_tSex_F <- -0.0938365059053137 #> a <- c(0, 0.24818990819019) #> b <- c(0, 0.0508665778176092) #> omega_Tlag ~ 0.383664766381593 #> omega_ka ~ 0.985719433448741 #> omega_V ~ 0.0278283386496708 #> omega_Cl ~ 0.0814219400052839 #> }) #> model({ #> cmt(depot) #> cmt(central) #> if (sex == 0) { #> tSex <- \"F\" #> } #> else if (sex == 1) { #> tSex <- \"M\" #> } #> else { #> tSex <- \"M\" #> } #> Tlag <- exp(Tlag_pop + omega_Tlag) #> ka <- exp(ka_pop + omega_ka) #> V <- exp(V_pop + beta_V_tSex_F * (tSex == \"F\") + omega_V) #> Cl <- exp(Cl_pop + beta_Cl_tSex_F * (tSex == \"F\") + omega_Cl) #> d/dt(depot) <- -ka * depot #> alag(depot) <- Tlag #> d/dt(central) <- +ka * depot - Cl/V * central #> Cc <- central/V #> concentration <- Cc #> concentration ~ add(a) + prop(b) + combined1() #> }) #> }"},{"path":"/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. ggplot2 autoplot lotri lotri magrittr %>% rxode2 expit, ini, logit, model, model<-, rxode, RxODE, rxode2, rxRename, rxSolve, rxUiGet","code":""},{"path":"/news/index.html","id":"monolix2rx-001","dir":"Changelog","previous_headings":"","what":"monolix2rx 0.0.1","title":"monolix2rx 0.0.1","text":"Initial CRAN submission.","code":""}]