-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.json
More file actions
1 lines (1 loc) · 415 KB
/
search.json
File metadata and controls
1 lines (1 loc) · 415 KB
1
[{"path":"https://mrgsolve.org/docs/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 2, June 1991Copyright © 1989, 1991 Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://mrgsolve.org/docs/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"licenses software designed take away freedom share change . contrast, GNU General Public License intended guarantee freedom share change free software–make sure software free users. General Public License applies Free Software Foundation’s software program whose authors commit using . (Free Software Foundation software covered GNU Lesser General Public License instead.) can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge service wish), receive source code can get want , can change software use pieces new free programs; know can things. protect rights, need make restrictions forbid anyone deny rights ask surrender rights. restrictions translate certain responsibilities distribute copies software, modify . example, distribute copies program, whether gratis fee, must give recipients rights . must make sure , , receive can get source code. must show terms know rights. protect rights two steps: (1) copyright software, (2) offer license gives legal permission copy, distribute /modify software. Also, author’s protection , want make certain everyone understands warranty free software. software modified someone else passed , want recipients know original, problems introduced others reflect original authors’ reputations. Finally, free program threatened constantly software patents. wish avoid danger redistributors free program individually obtain patent licenses, effect making program proprietary. prevent , made clear patent must licensed everyone’s free use licensed . precise terms conditions copying, distribution modification follow.","code":""},{"path":"https://mrgsolve.org/docs/LICENSE.html","id":"terms-and-conditions-for-copying-distribution-and-modification","dir":"","previous_headings":"","what":"TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION","title":"GNU General Public License","text":"0. License applies program work contains notice placed copyright holder saying may distributed terms General Public License. “Program”, , refers program work, “work based Program” means either Program derivative work copyright law: say, work containing Program portion , either verbatim modifications /translated another language. (Hereinafter, translation included without limitation term “modification”.) licensee addressed “”. Activities copying, distribution modification covered License; outside scope. act running Program restricted, output Program covered contents constitute work based Program (independent made running Program). Whether true depends Program . 1. may copy distribute verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice disclaimer warranty; keep intact notices refer License absence warranty; give recipients Program copy License along Program. may charge fee physical act transferring copy, may option offer warranty protection exchange fee. 2. may modify copy copies Program portion , thus forming work based Program, copy distribute modifications work terms Section 1 , provided also meet conditions: ) must cause modified files carry prominent notices stating changed files date change. b) must cause work distribute publish, whole part contains derived Program part thereof, licensed whole charge third parties terms License. c) modified program normally reads commands interactively run, must cause , started running interactive use ordinary way, print display announcement including appropriate copyright notice notice warranty (else, saying provide warranty) users may redistribute program conditions, telling user view copy License. (Exception: Program interactive normally print announcement, work based Program required print announcement.) requirements apply modified work whole. identifiable sections work derived Program, can reasonably considered independent separate works , License, terms, apply sections distribute separate works. distribute sections part whole work based Program, distribution whole must terms License, whose permissions licensees extend entire whole, thus every part regardless wrote . Thus, intent section claim rights contest rights work written entirely ; rather, intent exercise right control distribution derivative collective works based Program. addition, mere aggregation another work based Program Program (work based Program) volume storage distribution medium bring work scope License. 3. may copy distribute Program (work based , Section 2) object code executable form terms Sections 1 2 provided also one following: ) Accompany complete corresponding machine-readable source code, must distributed terms Sections 1 2 medium customarily used software interchange; , b) Accompany written offer, valid least three years, give third party, charge cost physically performing source distribution, complete machine-readable copy corresponding source code, distributed terms Sections 1 2 medium customarily used software interchange; , c) Accompany information received offer distribute corresponding source code. (alternative allowed noncommercial distribution received program object code executable form offer, accord Subsection b .) source code work means preferred form work making modifications . executable work, complete source code means source code modules contains, plus associated interface definition files, plus scripts used control compilation installation executable. However, special exception, source code distributed need include anything normally distributed (either source binary form) major components (compiler, kernel, ) operating system executable runs, unless component accompanies executable. distribution executable object code made offering access copy designated place, offering equivalent access copy source code place counts distribution source code, even though third parties compelled copy source along object code. 4. may copy, modify, sublicense, distribute Program except expressly provided License. attempt otherwise copy, modify, sublicense distribute Program void, automatically terminate rights License. However, parties received copies, rights, License licenses terminated long parties remain full compliance. 5. required accept License, since signed . However, nothing else grants permission modify distribute Program derivative works. actions prohibited law accept License. Therefore, modifying distributing Program (work based Program), indicate acceptance License , terms conditions copying, distributing modifying Program works based . 6. time redistribute Program (work based Program), recipient automatically receives license original licensor copy, distribute modify Program subject terms conditions. may impose restrictions recipients’ exercise rights granted herein. responsible enforcing compliance third parties License. 7. , consequence court judgment allegation patent infringement reason (limited patent issues), conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. distribute satisfy simultaneously obligations License pertinent obligations, consequence may distribute Program . example, patent license permit royalty-free redistribution Program receive copies directly indirectly , way satisfy License refrain entirely distribution Program. portion section held invalid unenforceable particular circumstance, balance section intended apply section whole intended apply circumstances. purpose section induce infringe patents property right claims contest validity claims; section sole purpose protecting integrity free software distribution system, implemented public license practices. Many people made generous contributions wide range software distributed system reliance consistent application system; author/donor decide willing distribute software system licensee impose choice. section intended make thoroughly clear believed consequence rest License. 8. distribution /use Program restricted certain countries either patents copyrighted interfaces, original copyright holder places Program License may add explicit geographical distribution limitation excluding countries, distribution permitted among countries thus excluded. case, License incorporates limitation written body License. 9. Free Software Foundation may publish revised /new versions General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies version number License applies “later version”, option following terms conditions either version later version published Free Software Foundation. Program specify version number License, may choose version ever published Free Software Foundation. 10. wish incorporate parts Program free programs whose distribution conditions different, write author ask permission. software copyrighted Free Software Foundation, write Free Software Foundation; sometimes make exceptions . decision guided two goals preserving free status derivatives free software promoting sharing reuse software generally.","code":""},{"path":"https://mrgsolve.org/docs/LICENSE.html","id":"no-warranty","dir":"","previous_headings":"","what":"NO WARRANTY","title":"GNU General Public License","text":"11. PROGRAM LICENSED FREE CHARGE, WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION. 12. EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MAY MODIFY /REDISTRIBUTE PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES. END TERMS CONDITIONS","code":""},{"path":"https://mrgsolve.org/docs/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively convey exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program interactive, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, commands use may called something show w show c; even mouse-clicks menu items–whatever suits program. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. sample; alter names: General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License.","code":"<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice"},{"path":"https://mrgsolve.org/docs/articles/extra/dollar-pred.html","id":"example-model","dir":"Articles > Extra","previous_headings":"","what":"Example model","title":"Models without compartments","text":"-basic model, look pred1 model modlib() model code random-intercept, random slope linear model. Like models mrgsolve, can write parameters ($PARAM), random effects ($OMEGA). model actually written $PRED. mrgsolve finds $PRED, generate error also finds $MAIN, $TABLE, $ODE. However, code gets entered $PRED function exactly put $TABLE. example model, response function parameter B, ’ll generate input data set values B Like models, can simulate population","code":"mod <- modlib(\"pred1\") $PROB An example model expressed in closed form $PARAM B = -1, beta0 = 100, beta1 = 0.1 $OMEGA 2 0.3 $PRED double beta0i = beta0 + ETA(1); double beta1i = beta1*exp(ETA(2)); capture Y = beta0i + beta1i*B; data <- tibble(ID = 1, B = exp(rnorm(100, 0,2))) head(data) ## # A tibble: 6 × 2 ## ID B ## <dbl> <dbl> ## 1 1 5.61 ## 2 1 0.749 ## 3 1 0.322 ## 4 1 0.150 ## 5 1 2.06 ## 6 1 4.06 out <- mrgsim_d(mod, data, carry_out = \"B\") plot(out, Y~B) df <- map_df(1:30, ~ tibble(ID = .x, B = seq(0,30,1))) head(df) ## # A tibble: 6 × 2 ## ID B ## <int> <dbl> ## 1 1 0 ## 2 1 1 ## 3 1 2 ## 4 1 3 ## 5 1 4 ## 6 1 5 mod %>% data_set(df) %>% mrgsim(carry_out = \"B\") %>% plot(Y ~ B)"},{"path":"https://mrgsolve.org/docs/articles/extra/dollar-pred.html","id":"pkpd-model","dir":"Articles > Extra","previous_headings":"","what":"PK/PD Model","title":"Models without compartments","text":"implementation PK/PD model using $PRED model Calculate CL function WT random effect Derive AUC CL DOSE response (Y) calculated AUC Emax model parameters simulate, look 50 subjects 5 doses Plot response (Y) versus AUC, colored dose","code":"code <- ' $PARAM TVCL = 1, WT = 70, AUC50 = 20, DOSE = 100, E0 = 35, EMAX = 2.4 $OMEGA 1 $SIGMA 100 $PRED double CL = TVCL*pow(WT/70,0.75)*exp(ETA(1)); capture AUC = DOSE/CL; capture Y = E0*(1+EMAX*AUC/(AUC50+AUC))+EPS(1); ' mod <- mcode_cache(\"pkpd\", code) set.seed(8765) data <- expand.idata(DOSE = c(30,50,80,110,200), ID = 1:50) %>% mutate(WT = exp(rnorm(n(),log(80),1))) head(data) ## ID DOSE WT ## 1 1 30 39.67626 ## 2 2 50 36.27156 ## 3 3 80 60.14424 ## 4 4 110 81.59561 ## 5 5 200 22.10396 ## 6 6 30 126.69565 out <- mrgsim_df(mod, data, carry_out=\"WT,DOSE\") head(out) ## ID time WT DOSE AUC Y ## 1 1 0 39.67626 30 298.76467 115.82635 ## 2 2 0 36.27156 50 108.78989 97.65895 ## 3 3 0 60.14424 80 13.74925 52.41350 ## 4 4 0 81.59561 110 186.47672 125.92038 ## 5 5 0 22.10396 200 494.49076 116.76226 ## 6 6 0 126.69565 30 22.61341 74.10551 ggplot(out, aes(AUC, Y, col =factor(DOSE))) + geom_point() + scale_x_log10(breaks = 10^seq(-4, 4)) + geom_smooth(aes(AUC,Y), se = FALSE, col=\"darkgrey\") + theme_bw() + scale_color_brewer(palette = \"Set2\", name = \"\") + theme(legend.position = \"top\")"},{"path":"https://mrgsolve.org/docs/articles/extra/events.html","id":"introduction","dir":"Articles > Extra","previous_headings":"","what":"Introduction","title":"Event objects","text":"Event objects simple ways implement PK dosing events model simulation. Let’s illustrate event objects one-compartment, PK model. read model mrgsolve internal model library.","code":"mod <- house(end = 216, delta = 0.1)"},{"path":"https://mrgsolve.org/docs/articles/extra/events.html","id":"events","dir":"Articles > Extra","previous_headings":"","what":"Events","title":"Event objects","text":"Events constructed ev() function implement 100 unit doses every 24 hours total 7 doses. e class ev, really just data frame can implement series doses passing e events argument mrgsim events can also implemented ev constructor along simulation pipeline","code":"e <- ev(amt = 100, ii = 24, addl = 6) e ## Events: ## time amt ii addl cmt evid ## 1 0 100 24 6 1 1 as.data.frame(e) ## time amt ii addl cmt evid ## 1 0 100 24 6 1 1 mod %>% mrgsim(events = e) %>% plot(GUT + CP ~ time) mod %>% ev(amt = 100, ii = 24, addl = 6) %>% mrgsim %>% plot(CP ~ time)"},{"path":"https://mrgsolve.org/docs/articles/extra/events.html","id":"event-defaults-and-expectations","dir":"Articles > Extra","previous_headings":"Events","what":"Event defaults and expectations","title":"Event objects","text":"amt required evid = 0 forbidden Default time 0 Default evid 1 Default cmt 1 Also default, rate, ss ii 0.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/events.html","id":"combine-events","dir":"Articles > Extra","previous_headings":"","what":"Combine events","title":"Event objects","text":"mrgsolve operators defined allow combine events. Let’s first define event objects. can combine e1 e3 collection operator mrgsolve also defines seq() method lets execute one event second event Notice e3 ii addl defined. required mrgsolve know start e2.","code":"e1 <- ev(amt = 500) e2 <- ev(amt = 250, ii = 24, addl = 4) e3 <- ev(amt = 500, ii = 24, addl = 0) e4 <- ev(amt = 250, ii = 24, addl = 4, time = 24) c(e1, e4) ## Events: ## time amt cmt evid ii addl ## 1 0 500 1 1 0 0 ## 2 24 250 1 1 24 4 seq(e3, e2) ## Events: ## time amt ii addl cmt evid ## 1 0 500 24 0 1 1 ## 2 24 250 24 4 1 1"},{"path":"https://mrgsolve.org/docs/articles/extra/events.html","id":"combine-to-create-a-data-set","dir":"Articles > Extra","previous_headings":"Combine events","what":"Combine to create a data set","title":"Event objects","text":"can take several event objects combine single simulation data frame as_data_set function. combined data set, get * N=5 IDs receiving 100 mg Q24h x7 * N=3 IDs receiving 50 mg Q12h x 14 * N=2 IDs receiving 200 mg Q48h x 3 simulate data set, use data_set function. First, let’s add OMEGA matrix model:","code":"e1 <- ev(amt = 100, ii = 24, addl = 6, ID = 1:5) e2 <- ev(amt = 50, ii = 12, addl = 13, ID = 1:3) e3 <- ev(amt = 200, ii = 24, addl = 2, ID = 1:2) data <- as_data_set(e1, e2, e3) data ## ID time amt ii addl cmt evid ## 1 1 0 100 24 6 1 1 ## 2 2 0 100 24 6 1 1 ## 3 3 0 100 24 6 1 1 ## 4 4 0 100 24 6 1 1 ## 5 5 0 100 24 6 1 1 ## 6 6 0 50 12 13 1 1 ## 7 7 0 50 12 13 1 1 ## 8 8 0 50 12 13 1 1 ## 9 9 0 200 24 2 1 1 ## 10 10 0 200 24 2 1 1 mod <- omat(mod, as_dmat(c(0.1, 0.1, 0.1, 0.1))) mod %>% data_set(data) %>% mrgsim(end=336) %>% plot(\"GUT, DV\")"},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"short-answer","dir":"Articles > Extra","previous_headings":"","what":"Short answer","title":"Set initial conditions","text":"two commonly-used ways set initial conditions: $MAIN initial condition list.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"set-initials-in-main","dir":"Articles > Extra","previous_headings":"Short answer","what":"Set initials in $MAIN","title":"Set initial conditions","text":"compartment called CMT, variable available called CMT_0 can use set initial condition compartment $MAIN. example: commonly-used way set initial conditions: initial condition RESP compartment set equal KIN divided KOUT. parameter called BASE, also write RESP_0 = BASE;. examples, ’re using data items $PARAM. initial condition set numeric value model, including individual parameters derived parameters, covariates, random effects. Note never declare RESP_0 (e.g. double RESP_0): just appears use.","code":"code <- ' $PARAM KIN = 200, KOUT = 50 $CMT RESP $MAIN RESP_0 = KIN/KOUT; '"},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"set-initials-in-the-init-list","dir":"Articles > Extra","previous_headings":"Short answer","what":"Set initials in the init list","title":"Set initial conditions","text":"can also set initial conditions initials list. commonly, means declaring compartments $INIT rather $CMT. example method gets us result previous example, however initial condition now derived value, coded number. Alternatively, declare compartment via $CMT update later (see next). can update value later like method commonly used set initial conditions large QSP models compartment starts known assumed steady state value.","code":"code <- ' $INIT RESP = 4 ' library(mrgsolve) mod <- mcode(\"init_up\", code) init(mod) ## ## Model initial conditions (N=1): ## name value . name value ## RESP (1) 4 | . ... . init(mod, RESP=8) %>% init ## ## Model initial conditions (N=1): ## name value . name value ## RESP (1) 8 | . ... ."},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"dont-use-initial-conditions-as-a-dosing-mechanism","dir":"Articles > Extra","previous_headings":"Short answer","what":"Don’t use initial conditions as a dosing mechanism","title":"Set initial conditions","text":"Using initial condition put starting dose compartment recommended. Always use dosing event .","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"long-answer","dir":"Articles > Extra","previous_headings":"","what":"Long answer","title":"Set initial conditions","text":"following wiki post topic. ’s pedantic. hopefully helpful learn mrgsolve want know. use $CMT, value base list assumed 0 every compartment mrgsolve default use values base list starting problem base list available, every individual get initial condition often, initial calculated function parameter example, $MAIN RESP_0 = KIN/KOUT; KIN KOUT value $PARAM code $MAIN overwrites value base list current ID equivalent might NONMEM model larger systems models, often just set initial value via base list","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"make-a-model-only-to-examine-init-behavior","dir":"Articles > Extra","previous_headings":"Long answer","what":"Make a model only to examine init behavior","title":"Set initial conditions","text":"Note: IFLAG invention demo. demo always responsible setting interpreting value (reserved way mrgsolve control value). demo Compartment initial condition defaults 0 Compartment initial condition get set BASE IFLAG > 0 Compartment always stays initial condition (system doesn’t advance) Check initial condition Note: used $CMT model spec; implies base initial condition set 0 chunk, code $MAIN doesn’t get run IFLAG 0 , don’t update something $MAIN initial condition set base list Next, update base initial condition 100 Note: code $MAIN still doesn’t get run IFLAG 0 Now, turn IFLAG Note: Now, code $MAIN gets run A_0 set value BASE","code":"code <- ' $PARAM BASE=200, IFLAG = 0 $CMT A $MAIN if(IFLAG > 0) A_0 = BASE; $ODE dxdt_A = 0; ' mod <- mcode(\"init_long\",code) dplot <- function(x) plot(x,ylim=c(0,400)) init(mod) ## ## Model initial conditions (N=1): ## name value . name value ## A (1) 0 | . ... . mod %>% mrgsim %>% dplot mod %>% init(A = 100) %>% mrgsim %>% dplot mod %>% param(IFLAG=1) %>% mrgsim %>% dplot mod %>% param(IFLAG=1, BASE=300) %>% mrgsim %>% dplot"},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"example-pkpd-model-with-initial-condition","dir":"Articles > Extra","previous_headings":"Long answer","what":"Example PK/PD model with initial condition","title":"Set initial conditions","text":"Just clear, need set sort flag set initial condition. initial condition set 40 per values KIN KOUT Even change RESP_0 R, calculation $MAIN gets final say","code":"code <- ' $PARAM AUC=0, AUC50 = 75, KIN=200, KOUT=5 $CMT RESP $MAIN RESP_0 = KIN/KOUT; $ODE dxdt_RESP = KIN*(1-AUC/(AUC50+AUC)) - KOUT*RESP; ' mod <- mcode(\"init_long2\", code) mod %>% mrgsim %>% plot mod %>% init(RESP=1E9) %>% mrgsim ## Model: init_long2 ## Dim: 25 x 3 ## Time: 0 to 24 ## ID: 1 ## ID time RESP ## 1: 1 0 40 ## 2: 1 1 40 ## 3: 1 2 40 ## 4: 1 3 40 ## 5: 1 4 40 ## 6: 1 5 40 ## 7: 1 6 40 ## 8: 1 7 40"},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"calling-init-will-let-you-check-to-see-what-is-going-on","dir":"Articles > Extra","previous_headings":"Long answer","what":"Calling init will let you check to see what is going on","title":"Set initial conditions","text":"’s good idea get habit things aren’t clear init first takes base initial condition list, calls $MAIN calculation ; result calculated initials","code":"init(mod) ## ## Model initial conditions (N=1): ## name value . name value ## RESP (1) 40 | . ... . mod %>% param(KIN=100) %>% init ## ## Model initial conditions (N=1): ## name value . name value ## RESP (1) 20 | . ... ."},{"path":"https://mrgsolve.org/docs/articles/extra/init.html","id":"set-initial-conditions-via-idata","dir":"Articles > Extra","previous_headings":"","what":"Set initial conditions via idata","title":"Set initial conditions","text":"Go back house model Notes idata (), include column CMT_0 (like ’d $MAIN). ID simulated, idata value override base initial list subject. note CMT_0 set $MAIN, override idata update.","code":"mod <- mrgsolve:::house() init(mod) ## ## Model initial conditions (N=3): ## name value . name value ## CENT (2) 0 | RESP (3) 50 ## GUT (1) 0 | . ... . idata <- expand.idata(CENT_0 = seq(0,25,1)) idata %>% head ## ID CENT_0 ## 1 1 0 ## 2 2 1 ## 3 3 2 ## 4 4 3 ## 5 5 4 ## 6 6 5 out <- mod %>% idata_set(idata) %>% mrgsim(end=40) plot(out, CENT~.)"},{"path":"https://mrgsolve.org/docs/articles/extra/modeled-event-time.html","id":"introduction","dir":"Articles > Extra","previous_headings":"","what":"Introduction","title":"Modeled events","text":"modeled event discontinuity introduced simulation time characteristics determined within model , rather standard setup specifying events via data set. vignette, ’ll focus creating discontinuity simulation value parameter can change specific time necessarily chosen prior run time.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/modeled-event-time.html","id":"example-with-single-mtime","dir":"Articles > Extra","previous_headings":"","what":"Example with single mtime","title":"Modeled events","text":"example, might wish rate constant change time found record input data set. can make happen model code using mtime(). Let’s make KA change 2.1 hours (change_t parameter example ). , main motivation just convenience economy code: register event time get time returned variable can reference later , checking past time . won’t see message actually stumbled 2.1 hours simulation even though lineup simulation started.","code":"[ param ] CL = 1, V = 20, KA1 = 0.1, KA2 = 2.5, change_t = 2.1 [ pkmodel ] cmt = \"GUT,CENT\", depot = TRUE [ main ] double mt = self.mtime(change_t); capture KA = KA1; if(TIME > mt) KA = KA2; if(TIME == change_t) { mrg::report(\"wait a minute ... time is 2.1?\"); } library(mrgsolve) library(dplyr) mod <- mread_cache(\"mtime-model.txt\") mod %>% ev(amt=100) %>% mrgsim(delta = 0.222) %>% plot(CENT+KA~time)"},{"path":"https://mrgsolve.org/docs/articles/extra/modeled-event-time.html","id":"example-with-several-mtimes","dir":"Articles > Extra","previous_headings":"","what":"Example with several mtimes","title":"Modeled events","text":"keep track several mtimes like ","code":"[ set ] end=8, delta=0.1 [ param ] CL = 1, V = 20, KA1 = 0.1, KA2 = 0.5, KA3 = 5, change_t = 1 [ pkmodel ] cmt = \"GUT,CENT\", depot = TRUE [ main ] double mt = self.mtime(change_t); double mt2 = self.mtime(change_t + 1); capture KA = KA1; if(TIME > mt) KA = KA2; if(TIME > mt2) KA = KA3; mod <- mread_cache(\"mtime-model-2.txt\") mod %>% ev(amt=100) %>% mrgsim() %>% plot(CENT + KA ~ time)"},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"introduction","dir":"Articles > Extra","previous_headings":"","what":"Introduction","title":"Steady-state","text":"mrgsolve 0.10.0 released October, 2019, made changes PK system advanced steady state. gave better control process -faithful result. also created opportunities users see warning messages hadn’t seen . changes made 0.10.1 release February, 2020. blog post describes mechanism mrgsolve finds steady state new change set (starting late 2019 early 2020) describes settings users can control advantage.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"tldr","dir":"Articles > Extra","previous_headings":"Introduction","what":"tl;dr","title":"Steady-state","text":"pass ss_n put upper cap number doses give finding SS pass ss_fixed silence warnings ss isn’t met set ss_cmt ([ set ]) include exclude certain compartments consideration finding SS use SS_ADVANCE logical flag [ ode ] advance certain compartments mrgsolve working find SS","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"how-does-mrgsolve-advance-the-pk-system-to-steady-state","dir":"Articles > Extra","previous_headings":"","what":"How does mrgsolve advance the PK system to steady state?","title":"Steady-state","text":"’s important recognize SS related PK dosing system. finding state system infinite number doses administered certain regimen. essentially mrgsolve goes finding steady state.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"for-example","dir":"Articles > Extra","previous_headings":"How does mrgsolve advance the PK system to steady state?","what":"For example","title":"Steady-state","text":"Let’s load PK model let’s imagine 100 mg QD dosing regimen give dose large number times Let’s just look trough concentrations see trough develops dosing period simulate Obviously, trough concentration starts increase certain period stops changing Looking compartment amount last trough compared second last trough, amounts aren’t changing much. mrgsolve finds steady state: keeps giving dose dosing interval pre-dose concentration stops changing much.","code":"library(dplyr) library(mrgsolve) mod <- house(end = 24, delta = 1) dose <- ev(amt = 100, ii = 24) dose <- mutate(dose, total = 1000) mod <- update(mod, delta = 24, end = 24*20, outvars = \"CENT, RESP\") out <- mrgsim_e(mod, dose, recsort = 3) plot(out) tail(out) ## ID time CENT RESP ## 17 1 360 44.97524 40.63012 ## 18 1 384 44.97524 40.63012 ## 19 1 408 44.97524 40.63012 ## 20 1 432 44.97524 40.63012 ## 21 1 456 44.97524 40.63012 ## 22 1 480 44.97524 40.63012"},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"how-close-is-close-enough","dir":"Articles > Extra","previous_headings":"","what":"How close is close enough?","title":"Steady-state","text":"need criterion determine much change pre-dose concentration ’ll tolerate still call good enough. mrgsolve uses local error estimate differential equation solver determine . determined rtol (relative tolerance) atol (absolute tolerance). difference two trough concentrations less Atrough_{trough} * rtol + atol, system said steady state. calculation done every single compartment model compartments meet criteria system said steady state. , increasing rtol (say 1e-8 1e-3) give us less precision answer also allow us call “good” respect steady state sooner. using one analytical models (one- two-compartment models solved ODEs), changing rtol influence answer (answer known closed form) continue influence easily quickly steady state achieved.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"how-many-doses","dir":"Articles > Extra","previous_headings":"","what":"How many doses?","title":"Steady-state","text":"volume larger, take doses get steady state time work us get place. Sometimes, simulated (many doses) reach steady state. mrgsim function argument called ss_n. maximum number doses given trying find steady state mrgsolve gives , issues warning keeps going problem. default value 500. , system gives 500 doses still can’t say system steady state, stop, issue warning keep going problem. expecting system reach steady state 500 doses, might good go back look model structure look parameters. might just handful individuals taking long time ’re fine just cutting 500th dose. case, can invoke ss_fixed argument. ss_fixed false default, ensuring get warning message system fails reach steady state. set ss_fixed true, system give ss_n doses stop without warning. , possibilities ss_n equal 500: SS reached 10 doses: great! stop 10 doses keep going regardless whether ss_fixed true false SS reached 500th dose ss_fixed false: keep going issuing warning SS process failed SS reached 500th dose ss_fixed true: keep going without issuing warning","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"what-could-possibly-go-wrong","dir":"Articles > Extra","previous_headings":"","what":"What could possibly go wrong?","title":"Steady-state","text":"Well, might seen warnings come wondered .","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"long-half-life","dir":"Articles > Extra","previous_headings":"What could possibly go wrong?","what":"Long half-life","title":"Steady-state","text":"Sometimes happens simulated parameters long half-life long time steady state, even 500 doses. might happen 1 2 3000 simulated individuals still give warning. might set ss_n something reasonable also set ss_fixed true don’t get warnings.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"one-compartment-misbehaves","dir":"Articles > Extra","previous_headings":"What could possibly go wrong?","what":"One compartment misbehaves","title":"Steady-state","text":"seen dosing compartment large inter-dose interval. amount gets driven small, maybe flips sign calculations steady state just don’t work right call “good”. ’s can : model, can now give vector compartment look handling steady state: -DEPOT says “forget DEPOT compartment running steady state”; giving numerical problems don’t really care one much either.","code":"[ set ] ss_cmt = \"-DEPOT\" [ cmt ] DEPOT CENT PERIPH [ ode ] dxdt_DEPOT = ...; dxdt_CENT = ...; dxdt_PERIPH = ...;"},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"auc-compartment-in-the-model","dir":"Articles > Extra","previous_headings":"What could possibly go wrong?","what":"AUC compartment in the model","title":"Steady-state","text":"Let’s say ’re accumulating stuff compartment AUC calculation. model, ’ll never make steady state according definition set . Rather trying figure hood, mrgsolve just asks tell forget AUC compartment determining steady state. another (better) way handle . Users new variable can check evaluates true mrgsolve advancing system steady state. might write : prevent AUC compartment advancing mrgsolve looking steady state. compartment won’t stumbling block SS determination (described ).","code":"[ set ] ss_cmt = \"-AUC\" [ cmt ] DEPOT CENT PERIPH AUC [ ode ] dxdt_DEPOT = ...; dxdt_CENT = ...; dxdt_PERIPH = ...; dxdt_AUC = CENT/V; [ cmt ] DEPOT CENT PERIPH AUC [ ode ] dxdt_DEPOT = ...; dxdt_CENT = ...; dxdt_PERIPH = ...; dxdt_AUC = CENT/V; if(SS_ADVANCE) dxdt_AUC = 0;"},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"only-consider-a-single-compartment","dir":"Articles > Extra","previous_headings":"What could possibly go wrong?","what":"Only consider a single compartment","title":"Steady-state","text":"Rather excluding misbehaving compartment, can also request one compartment evaluated SS ignores every compartment except CENT figuring SS.","code":"[ set ] ss_cmt = \"CENT\" [ cmt ] DEPOT CENT PERIPH [ ode ] dxdt_DEPOT = ...; dxdt_CENT = ...; dxdt_PERIPH = ...;"},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"summary","dir":"Articles > Extra","previous_headings":"","what":"Summary","title":"Steady-state","text":"pass ss_n put upper cap number doses give finding SS pass ss_fixed silence warnings ss isn’t met set ss_cmt ([ set ]) include exclude certain compartments consideration finding SS use SS_ADVANCE logical flag [ ode ] advance certain compartments mrgsolve working find SS","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/steady-state.html","id":"conclusion","dir":"Articles > Extra","previous_headings":"","what":"Conclusion","title":"Steady-state","text":"hope helpful explain steady state concepts mrgsolve better control process modeling workflow. see additional opportunities potentially coming future, like asking steady state finder use different rtol used solving differential equations. time , ’ll play configuration see additional changes helpful.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/time-after-dose.html","id":"introduction","dir":"Articles > Extra","previous_headings":"","what":"Introduction","title":"Time after dose","text":"TAD stands time dose. mrgsolve, time TAD calculated automatically, dose record input data set EVID set either 1 4.","code":""},{"path":"https://mrgsolve.org/docs/articles/extra/time-after-dose.html","id":"tad-calculated-as-runtime-argument","dir":"Articles > Extra","previous_headings":"","what":"TAD calculated as runtime argument","title":"Time after dose","text":", ’ve able get time dose simulated output convenient can choose output run time, give negative numbers prior first dose etc. sort calculation possible let mrgsolve know ahead time want calculation done mrgsolve makes extra pass records find first dose individual.","code":"library(mrgsolve) library(dplyr) mod <- modlib(\"pk1\", req = \"\") mod %>% ev(amt = 100, ii = 4, addl = 3, time = 2) %>% mrgsim(tad = TRUE, add = c(3.888,5.91)) %>% as_tibble() %>% head(n = 10) ## # A tibble: 10 × 4 ## ID time tad CP ## <dbl> <dbl> <dbl> <dbl> ## 1 1 0 -2 0 ## 2 1 1 -1 0 ## 3 1 2 0 0 ## 4 1 2 0 0 ## 5 1 3 1 3.07 ## 6 1 3.89 1.89 3.99 ## 7 1 4 2 4.05 ## 8 1 5 3 4.27 ## 9 1 5.91 3.91 4.22 ## 10 1 6 0 4.21"},{"path":"https://mrgsolve.org/docs/articles/extra/time-after-dose.html","id":"tad-calculated-in-the-model","dir":"Articles > Extra","previous_headings":"","what":"TAD calculated in the model","title":"Time after dose","text":"Sometimes like work time dose model. isn’t super-complicated require programming setup . mrgsolve 0.9.1, special function calculations . Looking [MAIN] block: call self.tad() get time dose. ’s important gets called every record … specifically every dosing record. work properly called every record check time make sure follow rule. please follow rule. see example: notice two differences tad (output requested run time) tadose (values calculated model ) output listing : tadose -1 first dose specifically, tadose -1 2 hour observation record occurs time dose, happens dose record order main point can easily obtain time dose problem (model) use program model also output number simulated output.","code":"mod <- mread(\"time-after-dose.txt\",req = \"\") [ param ] CL = 1, V = 20, KA = 1 [ pkmodel ] cmt = \"GUT,CENT\", depot = TRUE [ main ] capture tadose = self.tad(); [ table] capture CP = CENT/V; mod %>% ev(amt = 100, ii = 4, addl = 3, time = 2) %>% mrgsim(tad = TRUE, add = c(3.888, 5.91)) %>% as_tibble() %>% head(n = 10) ## # A tibble: 10 × 5 ## ID time tad tadose CP ## <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 1 0 -2 -1 0 ## 2 1 1 -1 -1 0 ## 3 1 2 0 -1 0 ## 4 1 2 0 0 0 ## 5 1 3 1 1 3.07 ## 6 1 3.89 1.89 1.89 3.99 ## 7 1 4 2 2 4.05 ## 8 1 5 3 3 4.27 ## 9 1 5.91 3.91 3.91 4.22 ## 10 1 6 0 0 4.21"},{"path":"https://mrgsolve.org/docs/articles/extra/time-after-dose.html","id":"time-after-dose-in-specific-compartment","dir":"Articles > Extra","previous_headings":"","what":"Time after dose in specific compartment","title":"Time after dose","text":"Version 0.10.7 adds new plugin ability calculate time dose compartment. write model using tad plugin track time dose compartments one two. create tadose objects track can call tad() method objects, passing self data item. Note time dose -1 dose administered. Recall also time dose can calculated simply one dose type passing tad argument: little nicer fill negative tad values .","code":"code <- ' [plugin] tad [ global ] mrg::tadose tad_cmt_1(1); mrg::tadose tad_cmt_2(2); [ pkmodel ] cmt = \"GUT,CENT\", depot = TRUE [ param ] CL = 1, V = 20, KA = 1 [ main ] capture tad1 = tad_cmt_1.tad(self); capture tad2 = tad_cmt_2.tad(self); ' mod <- mcode(\"tad\", code, soloc = '.') data <- c( ev(amt = 100, cmt = 1, time = 1), ev(amt = 200, cmt = 2, time = 3) ) mrgsim(mod, data) ## Model: tad ## Dim: 27 x 6 ## Time: 0 to 24 ## ID: 1 ## ID time GUT CENT tad1 tad2 ## 1: 1 0 0.000 0.00 -1 -1 ## 2: 1 1 0.000 0.00 -1 -1 ## 3: 1 1 100.000 0.00 0 -1 ## 4: 1 2 36.788 61.41 1 -1 ## 5: 1 3 13.534 81.00 2 -1 ## 6: 1 3 13.534 281.00 2 0 ## 7: 1 4 4.979 275.61 3 1 ## 8: 1 5 1.832 265.22 4 2 data1 <- filter(data, cmt ==1) %>% mutate(time = 3) mod %>% mrgsim(data1, tad = TRUE) ## Model: tad ## Dim: 26 x 7 ## Time: 0 to 24 ## ID: 1 ## ID time tad GUT CENT tad1 tad2 ## 1: 1 0 -3 0.000 0.00 -1 -1 ## 2: 1 1 -2 0.000 0.00 -1 -1 ## 3: 1 2 -1 0.000 0.00 -1 -1 ## 4: 1 3 0 0.000 0.00 -1 -1 ## 5: 1 3 0 100.000 0.00 0 -1 ## 6: 1 4 1 36.788 61.41 1 -1 ## 7: 1 5 2 13.534 81.00 2 -1 ## 8: 1 6 3 4.979 85.36 3 -1"},{"path":"https://mrgsolve.org/docs/articles/mrgsolve.html","id":"load-a-model","dir":"Articles","previous_headings":"","what":"Load a model","title":"Get started","text":"loading package ’ll use modlib() function read, parse, compile load model internal model library. models good try learning mrgsolve. first example, ’re using one compartment model (called pk1 model library) create model object (mod) can extract certain information model. example, get overview look model parameters values ’ll see section run simulation model. first, let’s create dosing intervention use model.","code":"library(dplyr) library(mrgsolve) mod <- modlib(\"pk1\") mod . . . ----------------- source: pk1.cpp ----------------- . . project: /private/var/fol...gsolve/models . shared object: pk1-so-1686cc9d55c9 . . time: start: 0 end: 24 delta: 1 . add: <none> . compartments: EV CENT [2] . parameters: CL V KA [3] . captures: CP [1] . omega: 0x0 . sigma: 0x0 . . solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar) . ------------------------------------------------------ param(mod) . . Model parameters (N=3): . name value . name value . CL 1 | V 20 . KA 1 | . ."},{"path":"https://mrgsolve.org/docs/articles/mrgsolve.html","id":"create-an-intervention","dir":"Articles","previous_headings":"","what":"Create an intervention","title":"Get started","text":"simplest way create intervention use event object. just simple expression one model interventions (frequently doses) ’ll see vignettes create -complicated events well create larger data sets many individuals . now, event object just intervention can combine model.","code":"evnt <- ev(amt = 100, ii = 24, addl = 9) evnt . Events: . time amt ii addl cmt evid . 1 0 100 24 9 1 1"},{"path":"https://mrgsolve.org/docs/articles/mrgsolve.html","id":"simulate","dir":"Articles","previous_headings":"","what":"Simulate","title":"Get started","text":"simulate, use mrgsim() function. use pipe sequence (%>%) pass model object (mod) event function (ev()) attach dosing intervention, result gets passed simulation function. result simulation function essentially data frame simulated values","code":"out <- mod %>% ev(evnt) %>% mrgsim(end = 480, delta = 0.1) out . Model: pk1 . Dim: 4802 x 5 . Time: 0 to 480 . ID: 1 . ID time EV CENT CP . 1: 1 0.0 0.00 0.000 0.0000 . 2: 1 0.0 100.00 0.000 0.0000 . 3: 1 0.1 90.48 9.492 0.4746 . 4: 1 0.2 81.87 18.034 0.9017 . 5: 1 0.3 74.08 25.715 1.2858 . 6: 1 0.4 67.03 32.619 1.6309 . 7: 1 0.5 60.65 38.819 1.9409 . 8: 1 0.6 54.88 44.383 2.2191"},{"path":"https://mrgsolve.org/docs/articles/mrgsolve.html","id":"plot","dir":"Articles","previous_headings":"","what":"Plot","title":"Get started","text":"mrgsolve comes several different functions processing output. One simple function plot method generate plot just simulated","code":"plot(out)"},{"path":"https://mrgsolve.org/docs/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Kyle T Baron. Author, maintainer. Bill Gillespie. Contributor. Charles Margossian. Contributor. Devin Pastoor. Contributor. Bill Denney. Contributor. Dilawar Singh. Contributor. Felicien Le Louedec. Contributor. Timothy Waterhouse. Contributor. Kyle Meyer. Contributor. Metrum Research Group. Copyright holder.","code":""},{"path":"https://mrgsolve.org/docs/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Baron K (2025). mrgsolve: Simulate ODE-Based Models. R package version 1.6.1, https://mrgsolve.org/docs/.","code":"@Manual{, title = {mrgsolve: Simulate from ODE-Based Models}, author = {Kyle T Baron}, year = {2025}, note = {R package version 1.6.1}, url = {https://mrgsolve.org/docs/}, }"},{"path":"https://mrgsolve.org/docs/index.html","id":"mrgsolve-","dir":"","previous_headings":"","what":"Simulate from ODE-Based Models","title":"Simulate from ODE-Based Models","text":"mrgsolve R package simulation hierarchical, ordinary differential equation (ODE) based models typically employed drug development. mrgsolve free open-source software.","code":""},{"path":"https://mrgsolve.org/docs/index.html","id":"resources","dir":"","previous_headings":"","what":"Resources","title":"Simulate from ODE-Based Models","text":"Please see mrgsolve.github.io additional resources, including: User Guide R Documentation Vignettes Gallery","code":""},{"path":"https://mrgsolve.org/docs/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Simulate from ODE-Based Models","text":"Install latest release CRAN Please sure see important install-related information . Install current development version","code":"install.packages(\"mrgsolve\") remotes::install_github(\"metrumresearchgroup/mrgsolve\")"},{"path":"https://mrgsolve.org/docs/index.html","id":"interaction","dir":"","previous_headings":"","what":"Interaction","title":"Simulate from ODE-Based Models","text":"welcome questions anything mrgsolve: installation, getting model work, understanding better mrgsolve works. also welcome suggestions make mrgsolve useful pharmacometrics community. Please interact us Issue Tracker. requires GitHub account.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/index.html","id":"a-simple-simulation","dir":"","previous_headings":"Some examples","what":"A simple simulation","title":"Simulate from ODE-Based Models","text":"Load model internal library Simulate simple regimen complicated regimen: 100 mg infusions 2 hours every 24 hours one week, followed 50 mg boluses every 12 hours 10 days:","code":"library(mrgsolve) mod <- mread(\"pk1\", modlib()) mod %>% ev(amt = 100, ii = 24, addl = 9) %>% mrgsim(end = 300, delta = 0.1) %>% plot(CP~time) mod %>% ev_rx(\"100 over 2h q 24 x 7 then 50 q 12 x 20\") %>% mrgsim(end = 600, delta = 0.1) %>% plot(CP~time)"},{"path":"https://mrgsolve.org/docs/index.html","id":"population-simulation","dir":"","previous_headings":"Some examples","what":"Population simulation","title":"Simulate from ODE-Based Models","text":"data set looking different patient weights doses Simulate","code":"mod <- mread(\"popex\", modlib()) %>% zero_re() library(dplyr) data <- expand.ev(amt = c(100,150), WT = seq(40,140,20)) %>% mutate(dose = amt) head(data) . ID time amt cmt evid WT dose . 1 1 0 100 1 1 40 100 . 2 2 0 150 1 1 40 150 . 3 3 0 100 1 1 60 100 . 4 4 0 150 1 1 60 150 . 5 5 0 100 1 1 80 100 . 6 6 0 150 1 1 80 150 mod %>% data_set(data) %>% carry_out(dose,WT) %>% mrgsim(delta = 0.1, end = 72) %>% plot(IPRED~time|factor(dose),scales = \"same\")"},{"path":"https://mrgsolve.org/docs/index.html","id":"sensitivity-analysis-with-pbpk-model","dir":"","previous_headings":"Some examples","what":"Sensitivity analysis with PBPK model","title":"Simulate from ODE-Based Models","text":"Reference Model parameters Set batch simulate","code":"mod <- modlib(\"pbpk\") . Building pbpk ... done. Model file: pbpk.cpp $PROB # HUMAN PBPK MODEL 1: Jones H, Rowland-Yeo K. Basic concepts in physiologically based pharmacokinetic modeling in drug discovery and development. CPT Pharmacometrics Syst Pharmacol. 2013 Aug 14;2:e63. doi: 10.1038/psp.2013.41. PubMed PMID: 23945604; PubMed Central PMCID: PMC3828005. param(mod) . . Model parameters (N=52): . name value . name value . name value . BP 0.98 | fumic 1 | FVve 0.0514 . BW 70 | fup 0.681 | HLM_CLint 8 . CLrenal 0 | FVad 0.213 | Ka 2.18 . CO 108 | FVar 0.0257 | Kpad 0.191 . F 1 | FVbo 0.0856 | Kpbo 0.374 . FQad 0.05 | FVbr 0.02 | Kpbr 0.606 . FQbo 0.05 | FVgu 0.0171 | Kpgu 0.578 . FQbr 0.12 | FVhe 0.0047 | Kphe 0.583 . FQgu 0.146 | FVki 0.0044 | Kpki 0.597 . FQh 0.215 | FVli 0.021 | Kpli 0.57 . FQhe 0.04 | FVlu 0.0076 | Kplu 0.62 . FQki 0.19 | FVmu 0.4 | Kpmu 0.622 . FQlu 1 | FVpl 0.0424 | Kpre 0.6 . FQmu 0.17 | FVrb 0.0347 | Kpsk 0.6 . FQre 0.104 | FVre 0.0998 | Kpsp 0.591 . FQsk 0.05 | FVsk 0.0371 | Kpte 0.6 . FQsp 0.0172 | FVsp 0.0026 | . . . FQte 0.0108 | FVte 0.01 | . . idata <- expand.idata(Kpli = seq(4,20,2)) idata . ID Kpli . 1 1 4 . 2 2 6 . 3 3 8 . 4 4 10 . 5 5 12 . 6 6 14 . 7 7 16 . 8 8 18 . 9 9 20 mod %>% ev(amt = 150) %>% idata_set(idata) %>% mrgsim(end = 6, delta = 0.1) %>% plot(Cp~time)"},{"path":"https://mrgsolve.org/docs/reference/BLOCK_PARSE.html","id":null,"dir":"Reference","previous_headings":"","what":"Functions to parse code blocks — BLOCK_PARSE","title":"Functions to parse code blocks — BLOCK_PARSE","text":"basic blocks listed help topic. see also PKMODEL() -involved options documented separately.","code":""},{"path":"https://mrgsolve.org/docs/reference/BLOCK_PARSE.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Functions to parse code blocks — BLOCK_PARSE","text":"","code":"PARAM( x, env, pos = 1, annotated = FALSE, object = NULL, as_object = FALSE, covariates = FALSE, input = FALSE, tag = NULL, ... ) FIXED(x, env, pos = 1, annotated = FALSE, ...) THETA( x, env, pos = 1, annotated = FALSE, object = NULL, as_object = FALSE, name = \"THETA\", fill = NULL, ... ) INIT(x, env, pos = 1, annotated = FALSE, object = NULL, as_object = FALSE, ...) CMT( x, env, pos = 1, annotated = FALSE, object = NULL, as_object = FALSE, number = NULL, prefix = \"A\", ... ) CAPTURE(x, env, pos = 1, annotated = FALSE, etas = NULL, ...) HANDLEMATRIX( x, env, pos = 1, annotated = FALSE, object = NULL, as_object = FALSE, name = \"...\", type = NULL, oclass = \"\", prefix = \"\", labels = NULL, unlinked = FALSE, ... )"},{"path":"https://mrgsolve.org/docs/reference/BLOCK_PARSE.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Functions to parse code blocks — BLOCK_PARSE","text":"x data env parse environment pos block position annotated logical object name object ENV as_object indicates object code provided covariates logical; mark covariates potentially required data input input logical; mark potentially required data input tag space comma-separated user-defined tags parameter block ... passed name block name fill deprecated; used number number compartments create prefix prefix add label etas allows block capture ETAs simulated output; R code get parsed evaluated; result integer-like vector identifies ETAs captured. type internal use oclass internal use labels aliases use simulated ETA values unlinked internal use","code":""},{"path":"https://mrgsolve.org/docs/reference/BLOCK_PARSE.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Functions to parse code blocks — BLOCK_PARSE","text":"using object as_object populate block contents, following types required PARAM: named list INIT : named list THETA : numeric vector; names ignored CMT: character vector OMEGA: matrix; set rownames matrix create ETA labels; setting rownames way specify labels working object as_object directives SIGMA: matrix; set rownames matrix create EPS labels; setting rownames way specify labels working object as_object directives","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/PKMODEL.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse PKMODEL BLOCK data — PKMODEL","title":"Parse PKMODEL BLOCK data — PKMODEL","text":"Parse PKMODEL BLOCK data","code":""},{"path":"https://mrgsolve.org/docs/reference/PKMODEL.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse PKMODEL BLOCK data — PKMODEL","text":"","code":"PKMODEL( ncmt = 1, depot = FALSE, cmt = NULL, trans = pick_trans(ncmt, depot), env = list(), pos = 1, ... )"},{"path":"https://mrgsolve.org/docs/reference/PKMODEL.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse PKMODEL BLOCK data — PKMODEL","text":"ncmt number compartments; must 1 (one-compartment, including depot dosing compartment) 2 (two-compartment model, including depot dosing compartment) depot logical indicating whether add depot compartment cmt compartment names comma-delimited character trans parameterization PK model; must 1, 2, 4, 11 env parse environment pos block position number ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/PKMODEL.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Parse PKMODEL BLOCK data — PKMODEL","text":"using $PKMODEL, certain symbols must defined model specification depending value ncmt, depot trans. ncmt 1, depot FALSE, trans 2: CL, V ncmt 1, depot TRUE , trans 2: CL, V, KA ncmt 2, depot FALSE, trans 4: CL, V1, Q, V2 ncmt 2, depot TRUE , trans 4: CL, V2, Q, V3, KA trans=11 specified, use symbols listed ncmt / depot combination, append end (e.g. CLi Qi KAi). trans=1, user must utilize following symbols: pred_CL clearance pred_V pred_V2 central compartment volume distribution pred_Q intercompartmental clearance pred_V3 peripheral compartment volume distribution pred_KA absorption rate constant","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/aboutsolver.html","id":null,"dir":"Reference","previous_headings":"","what":"About the lsoda differential equation solver used by mrgsolve — aboutsolver","title":"About the lsoda differential equation solver used by mrgsolve — aboutsolver","text":"differential equation solver C++ translation DLSODA ODEPACK. C++ translation created Dilawar Singh hosted https://github.com/dilawar/libsoda-cxx/. understand history code, Heng Li also involved early versions code written C. potentially-related project hosted https://github.com/sdwfrost/liblsoda/.","code":""},{"path":"https://mrgsolve.org/docs/reference/aboutsolver.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"About the lsoda differential equation solver used by mrgsolve — aboutsolver","text":"C++ translation Dilawar Singh contains functions appear based BLAS LAPACK routines. functions renamed distinct respective BLAS LAPACK function names. References given section .","code":""},{"path":"https://mrgsolve.org/docs/reference/aboutsolver.html","id":"history","dir":"Reference","previous_headings":"","what":"History","title":"About the lsoda differential equation solver used by mrgsolve — aboutsolver","text":"following history recorded source code published Dilawar Singh:","code":"/* * HISTORY: * This is a CPP version of the LSODA library for integration into MOOSE somulator. * The original was aquired from * http://www.ccl.net/cca/software/SOURCES/C/kinetics2/index.shtml and modified by * Heng Li <lh3lh3@gmail.com>. Heng merged several C files into one and added a * simpler interface. [Available here](http://lh3lh3.users.sourceforge.net/download/lsoda.c) * The original source code came with no license or copyright * information. Heng Li released his modification under the MIT/X11 license. I * maintain the same license. I have removed quite a lot of text/comments from * this library. Please refer to the standard documentation. * * Contact: Dilawar Singh <dilawars@ncbs.res.in> */"},{"path":"https://mrgsolve.org/docs/reference/aboutsolver.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"About the lsoda differential equation solver used by mrgsolve — aboutsolver","text":"LAPACK: https://netlib.org/lapack/ BLAS: https://netlib.org/blas/","code":""},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce an object to class ev — as.ev","title":"Coerce an object to class ev — as.ev","text":"Use function convert data frame event object.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce an object to class ev — as.ev","text":"","code":"as.ev(x, ...) # S4 method for class 'data.frame' as.ev(x, keep_id = TRUE, clean = FALSE, ...) # S4 method for class 'ev' as.ev(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce an object to class ev — as.ev","text":"x object coerce. ... used. keep_id TRUE, ID column retained exists. clean TRUE, dosing ID information retained result.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce an object to class ev — as.ev","text":"object class ev.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce an object to class ev — as.ev","text":"CMT (cmt) missing input, set 1 event object. TIME (time) missing input, set 0 event object. EVID (evid) missing input, set 1 event object.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.ev.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce an object to class ev — as.ev","text":"","code":"data <- data.frame(AMT = 100) as.ev(data) #> Events: #> time amt cmt evid #> 1 0 100 1 1 as.ev(data, clean = TRUE) #> Events: #> amt cmt evid #> 1 100 1 1"},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce a model object to list — as.list,mrgmod-method","title":"Coerce a model object to list — as.list,mrgmod-method","text":"Coerce model object list","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce a model object to list — as.list,mrgmod-method","text":"","code":"# S4 method for class 'mrgmod' as.list(x, deep = FALSE, ...)"},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce a model object to list — as.list,mrgmod-method","text":"x model object. deep TRUE, extra information returned output list (see Details). ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce a model object to list — as.list,mrgmod-method","text":"named list containing formatted contents x.","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce a model object to list — as.list,mrgmod-method","text":"deep TRUE, values trans, advan, mindt returned well summary internal model functions (call mrgsolve:::funset()).","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Coerce a model object to list — as.list,mrgmod-method","text":"npar: number parameters neq: number compartments differential equations pars: names model parameters covariates: names parameters identified covariates cmt: names model compartments param: parameter list init: initial condition list omega: $OMEGA matrices, matlist object sigma: $SIGMA matrices, matlist object fixed: named list $FIXED values model: model name project: model project directory soloc: directory model built sodll: complete path model shared object cfile: path model source code file shlib: list compilation information start: simulation start time end: simulation end time delta: simulation time step add: additional simulation times capture: names captured data items request: compartments requested upon simulation cmti: named indices current output compartments capturei: named indices current output capture random: names labels $OMEGA $SIGMA code: model source code cfile details: model details data frame nm_import: character vector listing names nonmem output files read import estimates completed nonmem run cpp_variables: data frame listing variables internal model cpp file atol: see solversettings rtol: see solversettings ss_atol: absolute tolerance use advancing PK steady state ss_rtol: relative tolerance use advancing PK steady state custom_atol: absolute tolerances, one compartment custom_rtol: relative tolerances, one compartment maxsteps: see solversettings hmin: see solversettings hmax: see solversettings itol: 1 (use scalar values) 4 (use customized values) itol_type: either \"scalar\" (itol = 1) \"custom\" (itol = 4) envir: model environment plugins: plugins invoked model digits: number digits request simulated data tscale: multiplicative scalar time results mindt: simulation output time model assume advanced preclean: logical indicating clean compilation artifacts prior compiling debug: print debugging information simulation run verbose: print extra information setup model run","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgmod-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce a model object to list — as.list,mrgmod-method","text":"","code":"mod <- mrgsolve::house() l <- as.list(mod)"},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgsims-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce an mrgsims object to list — as.list,mrgsims-method","title":"Coerce an mrgsims object to list — as.list,mrgsims-method","text":"Coerce mrgsims object list","code":""},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgsims-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce an mrgsims object to list — as.list,mrgsims-method","text":"","code":"# S4 method for class 'mrgsims' as.list(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/as.list-mrgsims-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce an mrgsims object to list — as.list,mrgsims-method","text":"x mrgsims object. ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a simulation data set from ev objects or data frames — as_data_set","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"goal take series event objects data frames combine single data frame can passed data_set().","code":""},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"","code":"as_data_set(x, ...) # S4 method for class 'ev' as_data_set(x, ...) # S4 method for class 'data.frame' as_data_set(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"x ev object data frame. ... additional ev objects data frames.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"data frame suitable passing data_set(). columns appear standardized order.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"event object data frame added data frame ID set IDs distinct IDs event objects. Note including ID argument ev() call length(ID) greater one render set events IDs requested. determining case output names, case attribute first ev object passed used set case output data.frame. event x data frame, case special column names (like amt/AMT cmt/CMT) first data frame assessed case output data frame determined based relative numbers lower upper names. get data frame one row (event) per ID, look expand.ev().","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/as_data_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a simulation data set from ev objects or data frames — as_data_set","text":"","code":"a <- ev(amt = c(100,200), cmt=1, ID = seq(3)) b <- ev(amt = 300, time = 24, ID = seq(2)) c <- ev(amt = 1000, ii = 8, addl = 10, ID = seq(3)) as_data_set(a, b, c) #> ID time amt ii addl cmt evid #> 1 1 0 100 0 0 1 1 #> 2 1 0 200 0 0 1 1 #> 3 2 0 100 0 0 1 1 #> 4 2 0 200 0 0 1 1 #> 5 3 0 100 0 0 1 1 #> 6 3 0 200 0 0 1 1 #> 7 4 24 300 0 0 1 1 #> 8 5 24 300 0 0 1 1 #> 9 6 0 1000 8 10 1 1 #> 10 7 0 1000 8 10 1 1 #> 11 8 0 1000 8 10 1 1 d <- evd(amt = 500) as_data_set(d, a) #> ID TIME AMT CMT EVID #> 1 1 0 500 1 1 #> 2 2 0 100 1 1 #> 3 2 0 200 1 1 #> 4 3 0 100 1 1 #> 5 3 0 200 1 1 #> 6 4 0 100 1 1 #> 7 4 0 200 1 1 # Output will have upper case nmtran names as_data_set( data.frame(AMT = 100, ID = 1:2), data.frame(amt = 200, rate = 5, cmt = 2) ) #> ID TIME AMT RATE CMT EVID #> 1 1 0 100 0 1 1 #> 2 2 0 100 0 1 1 #> 3 3 0 200 5 2 1 # Instead of this, use expand.ev as_data_set(ev(amt = 100), ev(amt = 200), ev(amt = 300)) #> ID time amt cmt evid #> 1 1 0 100 1 1 #> 2 2 0 200 1 1 #> 3 3 0 300 1 1"},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a list of designs from a data frame — as_deslist","title":"Create a list of designs from a data frame — as_deslist","text":"Create list designs data frame","code":""},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a list of designs from a data frame — as_deslist","text":"","code":"as_deslist(data, descol = \"ID\")"},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a list of designs from a data frame — as_deslist","text":"data input data set; see Details. descol character column name used design groups.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a list of designs from a data frame — as_deslist","text":"function returns list tgrid objects, one unique value found descol.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a list of designs from a data frame — as_deslist","text":"input data set must column name value descol. column names start (time first observation), end (time last observation), delta (time steps take start end), add (, ad-hoc times). Note add might list-column get vector times time grid object.","code":""},{"path":"https://mrgsolve.org/docs/reference/as_deslist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a list of designs from a data frame — as_deslist","text":"","code":"idata <- tibble::tibble(ID=1:4, end=seq(24,96,24), delta=6, add=list(c(122,124,135),c(111), c(99),c(88))) idata <- dplyr::mutate(idata, GRP = ID %%2) idata #> # A tibble: 4 × 5 #> ID end delta add GRP #> <int> <dbl> <dbl> <list> <dbl> #> 1 1 24 6 <dbl [3]> 1 #> 2 2 48 6 <dbl [1]> 0 #> 3 3 72 6 <dbl [1]> 1 #> 4 4 96 6 <dbl [1]> 0 l <- as_deslist(idata,\"GRP\") l #> $GRP_0 #> start: 0 end: 48 delta: 6 offset: 0 min: 0 max: 111 #> #> $GRP_1 #> start: 0 end: 24 delta: 6 offset: 0 min: 0 max: 135 #> #> attr(,\"descol\") #> [1] \"GRP\" lapply(l,stime) #> $GRP_0 #> [1] 0 6 12 18 24 30 36 42 48 111 #> #> $GRP_1 #> [1] 0 6 12 18 24 122 124 135 #> lapply(as_deslist(idata, \"ID\"),stime) #> $ID_1 #> [1] 0 6 12 18 24 122 124 135 #> #> $ID_2 #> [1] 0 6 12 18 24 30 36 42 48 111 #> #> $ID_3 #> [1] 0 6 12 18 24 30 36 42 48 54 60 66 72 99 #> #> $ID_4 #> [1] 0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 88 90 96 #>"},{"path":"https://mrgsolve.org/docs/reference/blocks.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the code blocks from a model specification file — blocks","title":"Return the code blocks from a model specification file — blocks","text":"Return code blocks model specification file","code":""},{"path":"https://mrgsolve.org/docs/reference/blocks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the code blocks from a model specification file — blocks","text":"","code":"blocks(x, ...) # S4 method for class 'mrgmod' blocks(x, ...) # S4 method for class 'character' blocks(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/blocks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the code blocks from a model specification file — blocks","text":"x model object path model specification file ... passed along","code":""},{"path":"https://mrgsolve.org/docs/reference/blocks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the code blocks from a model specification file — blocks","text":"","code":"mod <- mrgsolve::house() mod %>% blocks #> #> Model file: housemodel.cpp #> #> $PARAM #> @annotated #> CL : 1 : Clearance (L/hr) #> VC : 20 : Volume of distribution (L) #> KA : 1.2 : Absorption rate constant (1/hr) #> F1 : 1.0 : Bioavailability fraction (.) #> D1 : 2.0 : Infusion duration (hr) #> WTCL : 0.75 : Exponent WT on CL #> WTVC : 1.00 : Exponent WT on VC #> SEXCL: 0.7 : Prop cov effect on CL #> SEXVC: 0.85 : Prop cov effect on VC #> KIN : 100 : Resp prod rate constant (1/hr) #> KOUT : 2 : Resp elim rate constant (1/hr) #> IC50 : 10 : Conc giving 50% max resp (ng/ml) #> #> $PARAM #> @annotated @covariates #> WT : 70 : Weight (kg) #> SEX : 0 : Covariate female sex #> #> $MAIN #> F_GUT = F1; #> D_CENT = D1; #> double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL); #> double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC); #> double KAi = exp(log(KA) + EKA); #> double KOUTi = exp(log(KOUT) + EKOUT); #> RESP_0 = KIN/KOUTi; #> #> $ODE #> dxdt_GUT = -KAi*GUT; #> dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT; #> dxdt_RESP = KIN*(1-INH) - KOUTi*RESP; #> #> $TABLE #> double DV = CP*exp(EXPO); mod %>% blocks(PARAM,TABLE) #> #> Model file: housemodel.cpp #> #> $PARAM #> @annotated #> CL : 1 : Clearance (L/hr) #> VC : 20 : Volume of distribution (L) #> KA : 1.2 : Absorption rate constant (1/hr) #> F1 : 1.0 : Bioavailability fraction (.) #> D1 : 2.0 : Infusion duration (hr) #> WTCL : 0.75 : Exponent WT on CL #> WTVC : 1.00 : Exponent WT on VC #> SEXCL: 0.7 : Prop cov effect on CL #> SEXVC: 0.85 : Prop cov effect on VC #> KIN : 100 : Resp prod rate constant (1/hr) #> KOUT : 2 : Resp elim rate constant (1/hr) #> IC50 : 10 : Conc giving 50% max resp (ng/ml) #> #> $PARAM #> @annotated @covariates #> WT : 70 : Weight (kg) #> SEX : 0 : Covariate female sex #> #> $TABLE #> double DV = CP*exp(EXPO);"},{"path":"https://mrgsolve.org/docs/reference/cama.html","id":null,"dir":"Reference","previous_headings":"","what":"Run the model cama function — cama","title":"Run the model cama function — cama","text":"Run model cama function","code":""},{"path":"https://mrgsolve.org/docs/reference/cama.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run the model cama function — cama","text":"","code":"cama(mod, fn = \"cama\", ...)"},{"path":"https://mrgsolve.org/docs/reference/cama.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run the model cama function — cama","text":"mod model object. fn function name. ... passed update.","code":""},{"path":"https://mrgsolve.org/docs/reference/cama.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run the model cama function — cama","text":"sah-mah","code":""},{"path":"https://mrgsolve.org/docs/reference/carry_out.html","id":null,"dir":"Reference","previous_headings":"","what":"Select items to carry into simulated output — carry_out","title":"Select items to carry into simulated output — carry_out","text":"items named function found input data set (either data_set() idata_set()), copied simulated output. Special items like evid amt like copied data set per se, copied datarecord objects created simulation.","code":""},{"path":"https://mrgsolve.org/docs/reference/carry_out.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select items to carry into simulated output — carry_out","text":"","code":"carry_out(x, ...) carry.out(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/carry_out.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select items to carry into simulated output — carry_out","text":"x model object. ... unquoted names data items copy simulated output.","code":""},{"path":"https://mrgsolve.org/docs/reference/carry_out.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select items to carry into simulated output — carry_out","text":"also carry_out argument mrgsim() can set accomplish thing call carry_out pipeline. carry.carry_out thing; using underscore version now preferred.","code":""},{"path":"https://mrgsolve.org/docs/reference/carry_out.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select items to carry into simulated output — carry_out","text":"","code":"mod <- mrgsolve::house() e <- ev(amt = 100, ii = 6, addl = 3, WT = 70, dose = amt) out <- mod %>% ev(e) %>% carry_out(amt, dose, WT) %>% mrgsim() head(out) #> ID time amt dose WT GUT CENT RESP DV CP #> 1 1 0.00 0 100 70 0.00000 0.00000 50.00000 0.000000 0.000000 #> 2 1 0.00 100 100 70 100.00000 0.00000 50.00000 0.000000 0.000000 #> 3 1 0.25 0 100 70 74.08182 25.74883 48.68223 1.287441 1.287441 #> 4 1 0.50 0 100 70 54.88116 44.50417 46.18005 2.225208 2.225208 #> 5 1 0.75 0 100 70 40.65697 58.08258 43.61333 2.904129 2.904129 #> 6 1 1.00 0 100 70 30.11942 67.82976 41.37943 3.391488 3.391488"},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Check input data set names against model parameters — check_data_names","title":"Check input data set names against model parameters — check_data_names","text":"Use function check names input data sets parameters assigned different tags. Assignment made model specification file. useful alert user misspelled otherwise misspecified parameter names input data sets. See param_tags() information associating tags parameters.","code":""},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check input data set names against model parameters — check_data_names","text":"","code":"check_data_names( data, x, check_covariates = TRUE, check_inputs = TRUE, tags = NULL, mode = c(\"warn\", \"error\", \"inform\"), silent = FALSE )"},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check input data set names against model parameters — check_data_names","text":"data data frame object names check. x model object. check_covariates logical; TRUE, check data parameter names carrying covariates tag. check_inputs logical; TRUE, check data parameter names carrying input tag. tags character vector user-defined parameter tags require data; may comma- space-separated string (e.g. \"tag1,tag2\"). mode default \"warn\" user data missing expected column names; alternatively, use \"error\" issue error \"inform\" generate message data missing expected column names. silent silences message successful check.","code":""},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check input data set names against model parameters — check_data_names","text":"logical value returned; TRUE expected parameters found FALSE otherwise.","code":""},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check input data set names against model parameters — check_data_names","text":"default, data checked parameters covariates input tags; checks can bypassed check_covariates check_inputs arguments. parameter name missing data user warned default. Use mode = \"error\" generate error instead warning use mode = \"inform\" simply informed. user tagged parameters checking, either warning (default) error (mode = \"error\"). error request parameter tag via tags argument tag found model. error call check_data_names parameters tagged model specification file (see param_tags()).","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/check_data_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check input data set names against model parameters — check_data_names","text":"","code":"mod <- mcode(\"ex-cdn\", \"$PARAM @input \\n CL = 1, KA = 2\", compile = FALSE) param(mod) #> #> Model parameters (N=2): #> name value . name value #> CL 1 | KA 2 # Coding mistake! data <- expand.evd(amt = 100, cl = 2, KA = 5) check_data_names(data, mod) #> Warning: Could not find the following parameter names in `data`: #> • CL (input) #> ℹ Please check names in `data` against names in the parameter list. try(check_data_names(data, mod, mode = \"error\")) #> Error in check_data_names(data, mod, mode = \"error\") : #> Could not find the following parameter names in `data`: #> • CL (input) #> ✖ Please check names in `data` against names in the parameter list. check_data_names(data, mod, mode = \"inform\") #> Could not find the following parameter names in `data`: #> • CL (input)"},{"path":"https://mrgsolve.org/docs/reference/cmt_list-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 cmt_list class — cmt_list-class","title":"S4 cmt_list class — cmt_list-class","text":"S4 cmt_list class","code":""},{"path":"https://mrgsolve.org/docs/reference/cmtn.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the compartment number from a compartment name — cmtn","title":"Get the compartment number from a compartment name — cmtn","text":"Get compartment number compartment name","code":""},{"path":"https://mrgsolve.org/docs/reference/cmtn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the compartment number from a compartment name — cmtn","text":"","code":"cmtn(x, ...) # S4 method for class 'mrgmod' cmtn(x, tag, ...)"},{"path":"https://mrgsolve.org/docs/reference/cmtn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the compartment number from a compartment name — cmtn","text":"x model object. ... used. tag compartment name.","code":""},{"path":"https://mrgsolve.org/docs/reference/cmtn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the compartment number from a compartment name — cmtn","text":"","code":"mod <- mrgsolve::house() cmtn(mod, \"CENT\") #> [1] 2"},{"path":"https://mrgsolve.org/docs/reference/code.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract the code from a model — code","title":"Extract the code from a model — code","text":"function currently exported, sure call mrgsolve:::code(...).","code":""},{"path":"https://mrgsolve.org/docs/reference/code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract the code from a model — code","text":"","code":"code(x)"},{"path":"https://mrgsolve.org/docs/reference/code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract the code from a model — code","text":"x model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract the code from a model — code","text":"character vector model code.","code":""},{"path":"https://mrgsolve.org/docs/reference/code.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract the code from a model — code","text":"","code":"mod <- mrgsolve::house() mrgsolve:::code(mod) #> [1] \"$PROB \" #> [2] \"\" #> [3] \"# `mrgsolve` housemodel\" #> [4] \"\" #> [5] \"This model is compiled with `mrgsolve`.\" #> [6] \"\" #> [7] \" - Author: Metrum Research Group, LLC\" #> [8] \" - Description: Generic indirect response PK/PD model\" #> [9] \" - Covariates: Weight, female sex\" #> [10] \" - Random effects: CL, VC, KA, KOUT\" #> [11] \" - Error model: exponential\" #> [12] \"\" #> [13] \"\" #> [14] \"\" #> [15] \"$PLUGIN base\" #> [16] \"\" #> [17] \"$PARAM @annotated\" #> [18] \"CL : 1 : Clearance (L/hr)\" #> [19] \"VC : 20 : Volume of distribution (L)\" #> [20] \"KA : 1.2 : Absorption rate constant (1/hr)\" #> [21] \"F1 : 1.0 : Bioavailability fraction (.)\" #> [22] \"D1 : 2.0 : Infusion duration (hr)\" #> [23] \"WTCL : 0.75 : Exponent WT on CL\" #> [24] \"WTVC : 1.00 : Exponent WT on VC\" #> [25] \"SEXCL: 0.7 : Prop cov effect on CL\" #> [26] \"SEXVC: 0.85 : Prop cov effect on VC\" #> [27] \"KIN : 100 : Resp prod rate constant (1/hr)\" #> [28] \"KOUT : 2 : Resp elim rate constant (1/hr)\" #> [29] \"IC50 : 10 : Conc giving 50% max resp (ng/ml)\" #> [30] \"\" #> [31] \"$PARAM @annotated @covariates\" #> [32] \"WT : 70 : Weight (kg)\" #> [33] \"SEX : 0 : Covariate female sex\" #> [34] \"\" #> [35] \"$CMT @annotated\" #> [36] \"GUT : Dosing compartment (mg)\" #> [37] \"CENT : Central compartment (mg)\" #> [38] \"RESP : Response (unitless)\" #> [39] \"\" #> [40] \"$OMEGA @labels ECL EVC EKA EKOUT\" #> [41] \"0 0 0 0\" #> [42] \"\" #> [43] \"$SIGMA @labels EXPO\" #> [44] \"0\" #> [45] \"\" #> [46] \"$SET end=120, delta=0.25\" #> [47] \"\" #> [48] \"$GLOBAL\" #> [49] \"#define CP (CENT/VCi)\" #> [50] \"#define INH (CP/(IC50+CP))\" #> [51] \"\" #> [52] \"typedef double localdouble;\" #> [53] \"\" #> [54] \"$MAIN\" #> [55] \"F_GUT = F1;\" #> [56] \"D_CENT = D1;\" #> [57] \"\" #> [58] \"double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL);\" #> [59] \"double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC);\" #> [60] \"double KAi = exp(log(KA) + EKA);\" #> [61] \"double KOUTi = exp(log(KOUT) + EKOUT);\" #> [62] \"\" #> [63] \"RESP_0 = KIN/KOUTi;\" #> [64] \"\" #> [65] \"$ODE\" #> [66] \"dxdt_GUT = -KAi*GUT;\" #> [67] \"dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT;\" #> [68] \"dxdt_RESP = KIN*(1-INH) - KOUTi*RESP;\" #> [69] \"\" #> [70] \"$TABLE\" #> [71] \"double DV = CP*exp(EXPO);\" #> [72] \"\" #> [73] \"$CAPTURE @annotated\" #> [74] \"DV: Dependent variable (ng/ml)\" #> [75] \"CP: Plasma concentration (ng/ml)\" # Alternative as.list(mod)$code #> [1] \"$PROB \" #> [2] \"\" #> [3] \"# `mrgsolve` housemodel\" #> [4] \"\" #> [5] \"This model is compiled with `mrgsolve`.\" #> [6] \"\" #> [7] \" - Author: Metrum Research Group, LLC\" #> [8] \" - Description: Generic indirect response PK/PD model\" #> [9] \" - Covariates: Weight, female sex\" #> [10] \" - Random effects: CL, VC, KA, KOUT\" #> [11] \" - Error model: exponential\" #> [12] \"\" #> [13] \"\" #> [14] \"\" #> [15] \"$PLUGIN base\" #> [16] \"\" #> [17] \"$PARAM @annotated\" #> [18] \"CL : 1 : Clearance (L/hr)\" #> [19] \"VC : 20 : Volume of distribution (L)\" #> [20] \"KA : 1.2 : Absorption rate constant (1/hr)\" #> [21] \"F1 : 1.0 : Bioavailability fraction (.)\" #> [22] \"D1 : 2.0 : Infusion duration (hr)\" #> [23] \"WTCL : 0.75 : Exponent WT on CL\" #> [24] \"WTVC : 1.00 : Exponent WT on VC\" #> [25] \"SEXCL: 0.7 : Prop cov effect on CL\" #> [26] \"SEXVC: 0.85 : Prop cov effect on VC\" #> [27] \"KIN : 100 : Resp prod rate constant (1/hr)\" #> [28] \"KOUT : 2 : Resp elim rate constant (1/hr)\" #> [29] \"IC50 : 10 : Conc giving 50% max resp (ng/ml)\" #> [30] \"\" #> [31] \"$PARAM @annotated @covariates\" #> [32] \"WT : 70 : Weight (kg)\" #> [33] \"SEX : 0 : Covariate female sex\" #> [34] \"\" #> [35] \"$CMT @annotated\" #> [36] \"GUT : Dosing compartment (mg)\" #> [37] \"CENT : Central compartment (mg)\" #> [38] \"RESP : Response (unitless)\" #> [39] \"\" #> [40] \"$OMEGA @labels ECL EVC EKA EKOUT\" #> [41] \"0 0 0 0\" #> [42] \"\" #> [43] \"$SIGMA @labels EXPO\" #> [44] \"0\" #> [45] \"\" #> [46] \"$SET end=120, delta=0.25\" #> [47] \"\" #> [48] \"$GLOBAL\" #> [49] \"#define CP (CENT/VCi)\" #> [50] \"#define INH (CP/(IC50+CP))\" #> [51] \"\" #> [52] \"typedef double localdouble;\" #> [53] \"\" #> [54] \"$MAIN\" #> [55] \"F_GUT = F1;\" #> [56] \"D_CENT = D1;\" #> [57] \"\" #> [58] \"double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL);\" #> [59] \"double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC);\" #> [60] \"double KAi = exp(log(KA) + EKA);\" #> [61] \"double KOUTi = exp(log(KOUT) + EKOUT);\" #> [62] \"\" #> [63] \"RESP_0 = KIN/KOUTi;\" #> [64] \"\" #> [65] \"$ODE\" #> [66] \"dxdt_GUT = -KAi*GUT;\" #> [67] \"dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT;\" #> [68] \"dxdt_RESP = KIN*(1-INH) - KOUTi*RESP;\" #> [69] \"\" #> [70] \"$TABLE\" #> [71] \"double DV = CP*exp(EXPO);\" #> [72] \"\" #> [73] \"$CAPTURE @annotated\" #> [74] \"DV: Dependent variable (ng/ml)\" #> [75] \"CP: Plasma concentration (ng/ml)\""},{"path":"https://mrgsolve.org/docs/reference/collapse_matrices.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","title":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","text":"multiple OMEGA (SIGMA) blocks written model, can collapsed single matrix. change functionality model, alter OMEGA (SIGMA) updated, usually making easier. \"collapsing\" matrix list irreversible.","code":""},{"path":"https://mrgsolve.org/docs/reference/collapse_matrices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","text":"","code":"collapse_omega(x, range = NULL, name = NULL) collapse_sigma(x, range = NULL, name = NULL)"},{"path":"https://mrgsolve.org/docs/reference/collapse_matrices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","text":"x model object. range numeric vector length 2 specifying range matrices collapse case 2. second element may NA indicate length list matrices. name new name collapsed matrix; note matrix name, labels alias ETA(n) EPS(n); specifying name alter matrix potentially updated future.","code":""},{"path":"https://mrgsolve.org/docs/reference/collapse_matrices.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","text":"model object updated OMEGA SIGMA matrix lists.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/collapse_matrices.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse OMEGA or SIGMA matrix lists — collapse_omega","text":"","code":"code <- ' $OMEGA 1 2 3 $OMEGA 4 5 $OMEGA 6 7 8 9 ' mod <- mcode(\"collapse-example\", code, compile = FALSE) revar(mod) #> $omega #> $... #> [,1] [,2] [,3] #> 1: 1 0 0 #> 2: 0 2 0 #> 3: 0 0 3 #> #> $... #> [,1] [,2] #> 4: 4 0 #> 5: 0 5 #> #> $... #> [,1] [,2] [,3] [,4] #> 6: 6 0 0 0 #> 7: 0 7 0 0 #> 8: 0 0 8 0 #> 9: 0 0 0 9 #> #> #> $sigma #> No matrices found #> collapse_omega(mod) %>% omat() #> $... #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] #> 1: 1 0 0 0 0 0 0 0 0 #> 2: 0 2 0 0 0 0 0 0 0 #> 3: 0 0 3 0 0 0 0 0 0 #> 4: 0 0 0 4 0 0 0 0 0 #> 5: 0 0 0 0 5 0 0 0 0 #> 6: 0 0 0 0 0 6 0 0 0 #> 7: 0 0 0 0 0 0 7 0 0 #> 8: 0 0 0 0 0 0 0 8 0 #> 9: 0 0 0 0 0 0 0 0 9 #> collapse_omega(mod, range = c(2,3), name = \"new_matrix\") %>% omat() #> $... #> [,1] [,2] [,3] #> 1: 1 0 0 #> 2: 0 2 0 #> 3: 0 0 3 #> #> $new_matrix #> [,1] [,2] [,3] [,4] [,5] [,6] #> 4: 4 0 0 0 0 0 #> 5: 0 5 0 0 0 0 #> 6: 0 0 6 0 0 0 #> 7: 0 0 0 7 0 0 #> 8: 0 0 0 0 8 0 #> 9: 0 0 0 0 0 9 #> collapse_omega(mod, range = c(2,NA), name = \"new_matrix\") %>% omat() #> $... #> [,1] [,2] [,3] #> 1: 1 0 0 #> 2: 0 2 0 #> 3: 0 0 3 #> #> $new_matrix #> [,1] [,2] [,3] [,4] [,5] [,6] #> 4: 4 0 0 0 0 0 #> 5: 0 5 0 0 0 0 #> 6: 0 0 6 0 0 0 #> 7: 0 0 0 7 0 0 #> 8: 0 0 0 0 8 0 #> 9: 0 0 0 0 0 9 #>"},{"path":"https://mrgsolve.org/docs/reference/collapse_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse the matrices of a matlist object — collapse_matrix","title":"Collapse the matrices of a matlist object — collapse_matrix","text":"function called collapse_omega() collapse_sigma() convert multiple matrix blocks single matrix block. \"collapsing\" matrix list irreversible.","code":""},{"path":"https://mrgsolve.org/docs/reference/collapse_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse the matrices of a matlist object — collapse_matrix","text":"","code":"collapse_matrix(x, range = NULL, name = NULL)"},{"path":"https://mrgsolve.org/docs/reference/collapse_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse the matrices of a matlist object — collapse_matrix","text":"x object inherits matlist; object frequently extracted model object using omat() smat() OMEGA SIGMA, respectively. range numeric vector length 2 specifying range matrices collapse case 2. second element may NA indicate length list matrices. name new name collapsed matrix; note matrix name, labels alias ETA(n) EPS(n); specifying name alter matrix potentially updated future.","code":""},{"path":"https://mrgsolve.org/docs/reference/collapse_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse the matrices of a matlist object — collapse_matrix","text":"update matlist object (either omegalist sigmalist).","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/collapse_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse the matrices of a matlist object — collapse_matrix","text":"","code":"omega <- omat(list(dmat(1, 2), dmat(3, 4, 5))) omega #> $... #> [,1] [,2] #> 1: 1 0 #> 2: 0 2 #> #> $... #> [,1] [,2] [,3] #> 3: 3 0 0 #> 4: 0 4 0 #> 5: 0 0 5 #> collapse_matrix(omega) #> $... #> [,1] [,2] [,3] [,4] [,5] #> 1: 1 0 0 0 0 #> 2: 0 2 0 0 0 #> 3: 0 0 3 0 0 #> 4: 0 0 0 4 0 #> 5: 0 0 0 0 5 #>"},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":null,"dir":"Reference","previous_headings":"","what":"Customize tolerances for specific compartments — custom_tol","title":"Customize tolerances for specific compartments — custom_tol","text":"functions update relative absolute tolerance values custom tolerance configuration.","code":""},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Customize tolerances for specific compartments — custom_tol","text":"","code":"custom_tol(.x, .rtol = NULL, .atol = NULL) custom_rtol(.x, .rtol = list(), .default = NULL, .use = TRUE, ...) custom_atol(.x, .atol = list(), .default = NULL, .use = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Customize tolerances for specific compartments — custom_tol","text":".x model object. .rtol named numeric list vector, names reference selected model compartments relative tolerances compartments; custom_tol() also accepts name object model environment used. .atol named numeric list vector, names reference selected model compartments absolute tolerances compartments; custom_tol() also accepts name object model environment used. .default default tolerance value use compartments listed .rtol, .atol, ...; supplied, current scalar value .x used. .use logical; TRUE, call use_custom_tol() made prior return; FALSE, call use_scalar_tol() made; expected use, value argument kept TRUE, whenever tolerances customized, used next simulation run. ... name/value pairs, name references model compartment value new, numeric value use rtol atol.","code":""},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Customize tolerances for specific compartments — custom_tol","text":"updated model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Customize tolerances for specific compartments — custom_tol","text":"New tolerance values can supplied either named, numeric vector list via .rtol .atol via ... . duplicate compartment names found ... either .rtol .atol, value passed via ... take precedence. custom_tol() function provides mechanism coding customized tolerances model file . Simply create named numeric lists vectors customized rtol atol $ENV block. loading model, call custom_tol() supply names objects .rtol .atol.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/custom_tol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Customize tolerances for specific compartments — custom_tol","text":"","code":"mod <- house() mod <- custom_rtol(mod, GUT = 1e-2, CENT = 1e-3) new_tolerances <- c(GUT = 1e-4, RESP = 1e-5) mod <- custom_rtol(mod, new_tolerances, RESP = 1e-6)"},{"path":"https://mrgsolve.org/docs/reference/cvec.html","id":null,"dir":"Reference","previous_headings":"","what":"Create create character vectors — cvec","title":"Create create character vectors — cvec","text":"Create create character vectors","code":""},{"path":"https://mrgsolve.org/docs/reference/cvec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create create character vectors — cvec","text":"","code":"cvec(x) # S3 method for class 'character' cvec(x) s_(...)"},{"path":"https://mrgsolve.org/docs/reference/cvec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create create character vectors — cvec","text":"x comma-separated quoted string (cvec) ... unquoted strings (ch)","code":""},{"path":"https://mrgsolve.org/docs/reference/cvec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create create character vectors — cvec","text":"","code":"cvec(\"A,B,C\") #> [1] \"A\" \"B\" \"C\" s_(A,B,C) #> [1] \"A\" \"B\" \"C\""},{"path":"https://mrgsolve.org/docs/reference/data_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Select and modify a data set for simulation — data_set","title":"Select and modify a data set for simulation — data_set","text":"input data set (data_set) data frame specifies observations, model events, / parameter values population individuals.","code":""},{"path":"https://mrgsolve.org/docs/reference/data_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select and modify a data set for simulation — data_set","text":"","code":"data_set(x, data, ...) # S4 method for class 'mrgmod,data.frame' data_set( x, data, .subset = TRUE, .select = TRUE, object = NULL, need = NULL, ... ) # S4 method for class 'mrgmod,ANY' data_set(x, data, ...) # S4 method for class 'mrgmod,ev' data_set(x, data, ...) # S4 method for class 'mrgmod,missing' data_set(x, object, ...)"},{"path":"https://mrgsolve.org/docs/reference/data_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select and modify a data set for simulation — data_set","text":"x model object. data input data set data frame. ... arguments passed along object function. .subset unquoted expression passed dplyr::filter(); retain certain rows data set .select passed dplyr::select(); retain certain columns data set; result call dplyr::vars(). object character name object existing $ENV use data set. need passed inventory().","code":""},{"path":"https://mrgsolve.org/docs/reference/data_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select and modify a data set for simulation — data_set","text":"Input data sets R data frames can include columns valid name, however columns selected names treated specially mrgsolve incorporated simulation. ID specifies subject ID required every input data set. columns name parameters ($PARAM $INPUT model specification file), values columns used update corresponding parameter simulation progresses. Input data set may include following columns related PK dosing events: TIME, CMT, AMT, RATE, II, ADDL, SS. ID TIME required columns input data set unless $PRED use. Lower case PK dosing column names including time, cmt, amt, rate, ii, addl, ss also recognized. However, error generated mix upper case lower case columns family found. Use functions lctran() uctran() convert upper lower case naming data items. TIME observation event time, CMT compartment number (see init()), AMT dosing amount, RATE infusion rate, II dosing interval, ADDL specifies additional doses administer, ss flag indicating system advanced pharmacokinetic steady state prior administering dose. column names operate similarly non-linear mixed effects modeling software. EVID integer value specifying ID event record. Values include: 0: observation 1: dose event, either bolus infusion 2: -type event; mrgsolve, functions like observation record, discontinuity created simulation time event (.e., ODE solver stop restart time event) 3: reset system 4: reset system dose 8: replace amount compartment EVID greater 0, discontinuity created simulation, described EVID 2. error generated mrgsolve detects data set sorted time within individual. mrgsolve allow time reset zero records EVID set 4 (reset dose). numeric data can brought problem. non-numeric data columns dropped warning. See numerics_only(), used prepare data set. error generated parameter columns input data set contain missing values (NA). Likewise, error generated missing values found following columns: ID, time/TIME, rate/RATE. See exdatasets several example data sets provided mrgsolve.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/data_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select and modify a data set for simulation — data_set","text":"","code":"mod <- mrgsolve::house() data <- expand.ev(ID = seq(3), amt = c(10, 20)) mod %>% data_set(data, ID > 1) %>% mrgsim() #> Model: housemodel #> Dim: 2410 x 7 #> Time: 0 to 120 #> ID: 5 #> ID time GUT CENT RESP DV CP #> 1: 2 0.00 0.000 0.000 50.00 0.0000 0.0000 #> 2: 2 0.00 10.000 0.000 50.00 0.0000 0.0000 #> 3: 2 0.25 7.408 2.575 49.86 0.1287 0.1287 #> 4: 2 0.50 5.488 4.450 49.56 0.2225 0.2225 #> 5: 2 0.75 4.066 5.808 49.23 0.2904 0.2904 #> 6: 2 1.00 3.012 6.783 48.93 0.3391 0.3391 #> 7: 2 1.25 2.231 7.474 48.67 0.3737 0.3737 #> 8: 2 1.50 1.653 7.956 48.46 0.3978 0.3978 data(extran1) head(extran1) #> ID amt cmt time addl ii rate evid #> 1 1 1000 1 0 3 24 0 1 #> 2 2 1000 2 0 0 0 20 1 #> 3 3 1000 1 0 0 0 0 1 #> 4 3 500 1 24 0 0 0 1 #> 5 3 500 1 48 0 0 0 1 #> 6 3 1000 1 72 0 0 0 1 mod %>% data_set(extran1) %>% mrgsim() #> Model: housemodel #> Dim: 2414 x 7 #> Time: 0 to 120 #> ID: 5 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.0 0.0 50.00 0.00 0.00 #> 2: 1 0.00 1000.0 0.0 50.00 0.00 0.00 #> 3: 1 0.25 740.8 257.5 42.29 12.87 12.87 #> 4: 1 0.50 548.8 445.0 32.69 22.25 22.25 #> 5: 1 0.75 406.6 580.8 25.29 29.04 29.04 #> 6: 1 1.00 301.2 678.3 20.05 33.91 33.91 #> 7: 1 1.25 223.1 747.4 16.45 37.37 37.37 #> 8: 1 1.50 165.3 795.6 14.01 39.78 39.78 mod %>% mrgsim(data = extran1) #> Model: housemodel #> Dim: 2414 x 7 #> Time: 0 to 120 #> ID: 5 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.0 0.0 50.00 0.00 0.00 #> 2: 1 0.00 1000.0 0.0 50.00 0.00 0.00 #> 3: 1 0.25 740.8 257.5 42.29 12.87 12.87 #> 4: 1 0.50 548.8 445.0 32.69 22.25 22.25 #> 5: 1 0.75 406.6 580.8 25.29 29.04 29.04 #> 6: 1 1.00 301.2 678.3 20.05 33.91 33.91 #> 7: 1 1.25 223.1 747.4 16.45 37.37 37.37 #> 8: 1 1.50 165.3 795.6 14.01 39.78 39.78"},{"path":"https://mrgsolve.org/docs/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Set observation designs for the simulation — design","title":"Set observation designs for the simulation — design","text":"function also allows assign different designs different groups individuals population.","code":""},{"path":"https://mrgsolve.org/docs/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set observation designs for the simulation — design","text":"","code":"design(x, deslist = list(), descol = character(0), ...)"},{"path":"https://mrgsolve.org/docs/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set observation designs for the simulation — design","text":"x model object deslist list tgrid tgrids objects numeric vector used place ... descol idata column name (character) design assignment ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/design.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set observation designs for the simulation — design","text":"setup requires use idata_set, individual-level data passed one ID per row. ID, specify grouping variable idata (descol). unique value grouping variable, make one tgrid object pass order ... form list pass deslist. must assign idata_set assigning designs command chain (see example ).","code":""},{"path":"https://mrgsolve.org/docs/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set observation designs for the simulation — design","text":"","code":"peak <- tgrid(0,6,0.1) sparse <- tgrid(0,24,6) des1 <- c(peak,sparse) des2 <- tgrid(0,72,4) data <- expand.ev(ID = 1:10, amt=c(100,300)) data$GRP <- data$amt/100 idata <- data[,c(\"ID\", \"amt\")] mod <- mrgsolve::house() mod %>% omat(dmat(1,1,1,1)) %>% carry_out(GRP) %>% idata_set(idata) %>% design(list(des1, des2),\"amt\") %>% data_set(data) %>% mrgsim() %>% plot(RESP~time|GRP)"},{"path":"https://mrgsolve.org/docs/reference/details.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract model details — details","title":"Extract model details — details","text":"Extract model details","code":""},{"path":"https://mrgsolve.org/docs/reference/details.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract model details — details","text":"","code":"details(x, complete = FALSE, values = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/details.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract model details — details","text":"x model object complete logical; TRUE, un-annotated parameters compartments added output values logical; TRUE, values column added output ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/details.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract model details — details","text":"function exported. call mrgsolve:::details().","code":""},{"path":"https://mrgsolve.org/docs/reference/details.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract model details — details","text":"","code":"mod <- mrgsolve::house() mrgsolve:::details(mod) #> block name descr unit options value #> 1 PARAM CL Clearance L/hr . 1.00 #> 2 PARAM VC Volume of distribution L . 20.00 #> 3 PARAM KA Absorption rate constant 1/hr . 1.20 #> 4 PARAM F1 Bioavailability fraction . . 1.00 #> 5 PARAM D1 Infusion duration hr . 2.00 #> 6 PARAM WTCL Exponent WT on CL . . 0.75 #> 7 PARAM WTVC Exponent WT on VC . . 1.00 #> 8 PARAM SEXCL Prop cov effect on CL . . 0.70 #> 9 PARAM SEXVC Prop cov effect on VC . . 0.85 #> 10 PARAM KIN Resp prod rate constant 1/hr . 100.00 #> 11 PARAM KOUT Resp elim rate constant 1/hr . 2.00 #> 12 PARAM IC50 Conc giving 50% max resp ng/ml . 10.00 #> 13 PARAM WT Weight kg . 70.00 #> 14 PARAM SEX Covariate female sex . . 0.00 #> 15 CMT GUT Dosing compartment mg . 0.00 #> 16 CMT CENT Central compartment mg . 0.00 #> 17 CMT RESP Response unitless . 50.00 #> 18 CAPTURE DV Dependent variable ng/ml . NA #> 19 CAPTURE CP Plasma concentration ng/ml . NA"},{"path":"https://mrgsolve.org/docs/reference/env_eval.html","id":null,"dir":"Reference","previous_headings":"","what":"Re-evaluate the code in the ENV block — env_eval","title":"Re-evaluate the code in the ENV block — env_eval","text":"$ENV block block R code can realize sort R object might used running model.","code":""},{"path":"https://mrgsolve.org/docs/reference/env_eval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Re-evaluate the code in the ENV block — env_eval","text":"","code":"env_eval(x, seed = NULL)"},{"path":"https://mrgsolve.org/docs/reference/env_eval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Re-evaluate the code in the ENV block — env_eval","text":"x model object. seed passed set.seed() numeric value supplied.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/env_get.html","id":null,"dir":"Reference","previous_headings":"","what":"Return model environment — env_get","title":"Return model environment — env_get","text":"Return model environment","code":""},{"path":"https://mrgsolve.org/docs/reference/env_get.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return model environment — env_get","text":"","code":"env_get(x, tolist = TRUE) env_get_env(x)"},{"path":"https://mrgsolve.org/docs/reference/env_get.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return model environment — env_get","text":"x model object. tolist environment coerced list?","code":""},{"path":"https://mrgsolve.org/docs/reference/env_ls.html","id":null,"dir":"Reference","previous_headings":"","what":"List objects in the model environment — env_ls","title":"List objects in the model environment — env_ls","text":"model keeps internal environment allows user carry R object along. Objects coded $ENV.","code":""},{"path":"https://mrgsolve.org/docs/reference/env_ls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List objects in the model environment — env_ls","text":"","code":"env_ls(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/env_ls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List objects in the model environment — env_ls","text":"x model object. ... passed ls().","code":""},{"path":"https://mrgsolve.org/docs/reference/env_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update objects in model environment — env_update","title":"Update objects in model environment — env_update","text":"Update objects model environment","code":""},{"path":"https://mrgsolve.org/docs/reference/env_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update objects in model environment — env_update","text":"","code":"env_update(.x, ..., .dots = list())"},{"path":"https://mrgsolve.org/docs/reference/env_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update objects in model environment — env_update","text":".x model object. ... objects update. .dots list objects updated.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 events class — ev-class","title":"S4 events class — ev-class","text":"S4 events class","code":""},{"path":"https://mrgsolve.org/docs/reference/ev-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 events class — ev-class","text":"data data frame events case indicates handle column naming upon coerce data.frame","code":""},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":null,"dir":"Reference","previous_headings":"","what":"Event objects for simulating PK and other interventions — ev","title":"Event objects for simulating PK and other interventions — ev","text":"event object specifies dosing interventions get implemented simulation. Event objects similar things data_set, simpler easier create.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Event objects for simulating PK and other interventions — ev","text":"","code":"ev(x, ...) # S4 method for class 'mrgmod' ev(x, object = NULL, ...) # S4 method for class 'missing' ev( time = 0, amt = 0, evid = 1, cmt = 1, ID = numeric(0), replicate = TRUE, until = NULL, tinf = NULL, realize_addl = FALSE, ... ) # S4 method for class 'ev' ev(x, realize_addl = FALSE, ...)"},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Event objects for simulating PK and other interventions — ev","text":"x model object. ... items incorporated event object; see Details. object event object added model object. time event time. amt dose amount. evid event ID. cmt compartment number name. ID subject ID. replicate logical; TRUE, events replicated individual ID. expected maximum observation time regimen; doses scheduled , including, time; see Examples. tinf infusion time; greater zero, rate item derived amt/tinf. realize_addl FALSE (default), change addl doses. TRUE, addl doses made explicit realize_addl().","code":""},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Event objects for simulating PK and other interventions — ev","text":"ev() returns event object.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Event objects for simulating PK and other interventions — ev","text":"Required items events objects include time, amt, evid cmt. supplied, evid assumed 1. supplied, cmt assumed 1. supplied, time assumed 0. amt supplied, error generated. total supplied, addl set total-1. items can include ii, ss, addl (see data_set details items). ID may specified vector. replicate TRUE (default), events regimen replicated ID; otherwise, number event rows must match number IDs entered.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/ev.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Event objects for simulating PK and other interventions — ev","text":"","code":"mod <- mrgsolve::house() mod <- mod %>% ev(amt = 1000, time = 0, cmt = 1) loading <- ev(time = 0, cmt = 1, amt = 1000) maint <- ev(time = 12, cmt = 1, amt = 500, ii = 12, addl = 10) c(loading, maint) #> Events: #> time amt cmt evid ii addl #> 1 0 1000 1 1 0 0 #> 2 12 500 1 1 12 10 reduced_load <- dplyr::mutate(loading, amt = 750) # Three additional doses in this case e <- ev(amt = 100, ii = 4*7, until = 16*7) e #> Events: #> time amt ii addl cmt evid #> 1 0 100 28 3 1 1 # Last dose is given at 84 realize_addl(e) #> Events: #> time amt ii addl cmt evid #> 1 0 100 0 0 1 1 #> 2 28 100 0 0 1 1 #> 3 56 100 0 0 1 1 #> 4 84 100 0 0 1 1 # Four additional doses with last at 112 in this case e <- ev(amt = 100, ii = 4*7, until = 16*7 + 0.001) realize_addl(e) #> Events: #> time amt ii addl cmt evid #> 1 0 100 0 0 1 1 #> 2 28 100 0 0 1 1 #> 3 56 100 0 0 1 1 #> 4 84 100 0 0 1 1 #> 5 112 100 0 0 1 1"},{"path":"https://mrgsolve.org/docs/reference/ev_assign.html","id":null,"dir":"Reference","previous_headings":"","what":"Replicate a list of events into a data set — ev_assign","title":"Replicate a list of events into a data set — ev_assign","text":"Replicate list events data set","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_assign.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replicate a list of events into a data set — ev_assign","text":"","code":"ev_assign(l, idata, evgroup, join = FALSE) assign_ev(...)"},{"path":"https://mrgsolve.org/docs/reference/ev_assign.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replicate a list of events into a data set — ev_assign","text":"l list event objects. idata idata set (one ID per row). evgroup character name column idata specifies event object implement. join TRUE, join idata data set returning. ... used pass arguments assign_ev(). ev_assign().","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_assign.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Replicate a list of events into a data set — ev_assign","text":"ev_assign() connects events list passed l argument values data set identified evgroup argument. making assignments, unique values evgroup column first sorted first sorted unique value evgroup assigned first event l, second sorted value evgroup column assigned second event l, . change previous behavior, sort unique values evgroup prior making assignments.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_assign.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replicate a list of events into a data set — ev_assign","text":"","code":"ev1 <- ev(amt = 100) ev2 <- ev(amt = 300, rate = 100, ii = 12, addl = 10) idata <- data.frame(ID = seq(10)) idata$arm <- 1+(idata$ID %%2) ev_assign(list(ev1, ev2), idata, \"arm\", join = TRUE) #> time amt cmt evid rate ii addl ID arm #> 1 0 300 1 1 100 12 10 1 2 #> 2 0 100 1 1 0 0 0 2 1 #> 3 0 300 1 1 100 12 10 3 2 #> 4 0 100 1 1 0 0 0 4 1 #> 5 0 300 1 1 100 12 10 5 2 #> 6 0 100 1 1 0 0 0 6 1 #> 7 0 300 1 1 100 12 10 7 2 #> 8 0 100 1 1 0 0 0 8 1 #> 9 0 300 1 1 100 12 10 9 2 #> 10 0 100 1 1 0 0 0 10 1"},{"path":"https://mrgsolve.org/docs/reference/ev_days.html","id":null,"dir":"Reference","previous_headings":"","what":"Schedule dosing events on days of the week — ev_days","title":"Schedule dosing events on days of the week — ev_days","text":"function lets schedule doses specific days week, allowing create dosing regimens Monday/Wednesday/Friday, Tuesday/Thursday, every day (however want define ) etc.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_days.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Schedule dosing events on days of the week — ev_days","text":"","code":"ev_days( ev = NULL, days = \"\", addl = 0, ii = 168, unit = c(\"hours\", \"days\"), ... )"},{"path":"https://mrgsolve.org/docs/reference/ev_days.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Schedule dosing events on days of the week — ev_days","text":"ev event object. days comma- space-separated character string valid days week (see details). addl additional doses administer. ii inter-dose interval; intended use keep default value. unit time unit; function can currently handle hours days. ... event objects named one valid days week (see Details).","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_days.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Schedule dosing events on days of the week — ev_days","text":"Valid names week : m Monday t Tuesday w Wednesday th Thursday f Friday sa Saturday s Sunday whole purpose function schedule doses specific days week, repeating weekly schedule. Please use caution changing ii default value.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_days.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Schedule dosing events on days of the week — ev_days","text":"","code":"# Monday, Wednesday, Friday x 4 weeks e1 <- ev(amt = 100) ev_days(e1, days=\"m,w,f\", addl = 3) #> time amt cmt evid ii addl #> 1 0 100 1 1 168 3 #> 2 48 100 1 1 168 3 #> 3 96 100 1 1 168 3 # 50 mg Tuesdays, 100 mg Thursdays x 6 months e2 <- ev(amt = 50) ev_days(t = e2, th = e1, addl = 23) #> time amt cmt evid ii addl #> 1 24 50 1 1 168 23 #> 2 72 100 1 1 168 23"},{"path":"https://mrgsolve.org/docs/reference/ev_dplyr.html","id":null,"dir":"Reference","previous_headings":"","what":"dplyr verbs for event objects — mutate.ev","title":"dplyr verbs for event objects — mutate.ev","text":"dplyr verbs event objects","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_dplyr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"dplyr verbs for event objects — mutate.ev","text":"","code":"# S3 method for class 'ev' mutate(.data, ...) # S3 method for class 'ev' select(.data, ...) # S3 method for class 'ev' filter(.data, ...)"},{"path":"https://mrgsolve.org/docs/reference/ev_dplyr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"dplyr verbs for event objects — mutate.ev","text":".data event object. ... passed dplyr function.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_extract.html","id":null,"dir":"Reference","previous_headings":"","what":"Select columns from an ev object — $,ev-method","title":"Select columns from an ev object — $,ev-method","text":"Select columns ev object","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_extract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select columns from an ev object — $,ev-method","text":"","code":"# S4 method for class 'ev' x$name # S4 method for class 'ev' x[[i, exact = TRUE]]"},{"path":"https://mrgsolve.org/docs/reference/ev_extract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select columns from an ev object — $,ev-method","text":"x ev object name column select element select exact used","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Various methods for event objects — ev_methods","title":"Various methods for event objects — ev_methods","text":"Various methods event objects","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Various methods for event objects — ev_methods","text":"","code":"# S3 method for class 'ev' names(x) # S3 method for class 'ev' dim(x) # S3 method for class 'ev' as.matrix(x, ...) # S3 method for class 'ev' as.data.frame(x, row.names = NULL, optional = FALSE, add_ID = NULL, ...) # S4 method for class 'ev' show(object)"},{"path":"https://mrgsolve.org/docs/reference/ev_methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Various methods for event objects — ev_methods","text":"x events object ... passed various methods row.names passed .data.frame optional passed .data.frame add_ID numeric ID length 1 used add ID column one already exist object used show","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Various methods for event objects — ev_methods","text":"","code":"e <- ev(amt = 100) names(e) #> [1] \"time\" \"amt\" \"cmt\" \"evid\" as.data.frame(e) #> time amt cmt evid #> 1 0 100 1 1 dim(e) #> [1] 1 4 nrow(e) #> [1] 1"},{"path":"https://mrgsolve.org/docs/reference/ev_ops.html","id":null,"dir":"Reference","previous_headings":"","what":"Operations for ev objects — ev_ops","title":"Operations for ev objects — ev_ops","text":"Operations ev objects","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_ops.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Operations for ev objects — ev_ops","text":"","code":"# S4 method for class 'ev,ev' e1 + e2 e1 %then% e2 # S4 method for class 'ev,ev' e1 %then% e2 # S4 method for class 'ev,numeric' e1 + e2 # S4 method for class 'ev' c(x, ..., recursive = TRUE)"},{"path":"https://mrgsolve.org/docs/reference/ev_ops.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Operations for ev objects — ev_ops","text":"e1 object left hand side operator (lhs) e2 object right hand side operator (rhs) x ev object ... ev objects collect recursive used","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_ops.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Operations for ev objects — ev_ops","text":"operations involving mrgmod objects deprecated.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rep.html","id":null,"dir":"Reference","previous_headings":"","what":"Replicate an event object — ev_rep","title":"Replicate an event object — ev_rep","text":"event sequence can replicated certain number times certain number IDs.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replicate an event object — ev_rep","text":"","code":"ev_rep(x, ID = 1, n = NULL, wait = 0, as.ev = FALSE, id = NULL)"},{"path":"https://mrgsolve.org/docs/reference/ev_rep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replicate an event object — ev_rep","text":"x event object. ID numeric vector IDs. n passed ev_repeat(). wait passed ev_repeat(). .ev TRUE event object returned. id deprecated; use ID instead.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replicate an event object — ev_rep","text":"single data.frame event object determined value .ev().","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/ev_rep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replicate an event object — ev_rep","text":"","code":"e1 <- c(ev(amt=100), ev(amt=200, ii=24, addl=2, time=72)) ev_rep(e1, 1:5) #> ID time amt cmt evid ii addl #> 1 1 0 100 1 1 0 0 #> 2 1 72 200 1 1 24 2 #> 3 2 0 100 1 1 0 0 #> 4 2 72 200 1 1 24 2 #> 5 3 0 100 1 1 0 0 #> 6 3 72 200 1 1 24 2 #> 7 4 0 100 1 1 0 0 #> 8 4 72 200 1 1 24 2 #> 9 5 0 100 1 1 0 0 #> 10 5 72 200 1 1 24 2"},{"path":"https://mrgsolve.org/docs/reference/ev_repeat.html","id":null,"dir":"Reference","previous_headings":"","what":"Repeat a block of dosing events — ev_repeat","title":"Repeat a block of dosing events — ev_repeat","text":"Repeat block dosing events","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_repeat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Repeat a block of dosing events — ev_repeat","text":"","code":"ev_repeat(x, n, wait = 0, as.ev = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/ev_repeat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Repeat a block of dosing events — ev_repeat","text":"x event object dosing data frame. n number times repeat. wait time wait repeats. .ev TRUE, event object returned; otherwise data.frame returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_repeat.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Repeat a block of dosing events — ev_repeat","text":"See .ev argument.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_repeat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Repeat a block of dosing events — ev_repeat","text":"","code":"e1 <- ev(amt = 100, ii = 24, addl = 20) e4 <- ev_repeat(e1, n = 4, wait = 168) mod <- mrgsolve::house() out <- mrgsim(mod, events = e4, end = 3200) plot(out, \"CP\")"},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":null,"dir":"Reference","previous_headings":"","what":"Create intervention objects from Rx input — ev_rx","title":"Create intervention objects from Rx input — ev_rx","text":"See details Rx specification. Actual parsing done parse_rx(); function can used debug Rx inputs.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create intervention objects from Rx input — ev_rx","text":"","code":"ev_rx(x, y, ...) # S4 method for class 'mrgmod,character' ev_rx(x, y, ...) # S4 method for class 'character,missing' ev_rx(x, df = FALSE, ...) parse_rx(x)"},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create intervention objects from Rx input — ev_rx","text":"x model object character Rx input. y character Rx input; see details. ... used time. df TRUE data frame returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create intervention objects from Rx input — ev_rx","text":"method dispatched model object (mrgmod) returns another model object. character method returns event object. parse_rx function return list named arguments event object constructor ev().","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":"rx-specification","dir":"Reference","previous_headings":"","what":"Rx specification","title":"Create intervention objects from Rx input — ev_rx","text":"dose found start string sequential digits; may integer, decimal, specified scientific notation Use identify dosing compartment number; must integer Use q identify dosing interval; must integer decimal number (scientific notation) Use indicate infusion duration; integer decimal number Use x indicate total number doses; must integer Use , separate dosing periods Use insert lag start period; integer decimal number (scientific notation) Use & implement multiple doses time","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_rx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create intervention objects from Rx input — ev_rx","text":"","code":"# example(\"ev_rx\") ev_rx(\"100\") #> Events: #> time amt cmt evid #> 1 0 100 1 1 ev_rx(\"100 in 2\") #> Events: #> time amt cmt evid #> 1 0 100 2 1 ev_rx(\"100 q12 x 3\") #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 2 1 1 ev_rx(\"100 over 2\") #> Events: #> time amt rate cmt evid #> 1 0 100 50 1 1 ev_rx(\"100 q 24 x 3 then 50 q12 x 2\") #> Events: #> time amt ii addl cmt evid #> 1 0 100 24 2 1 1 #> 2 72 50 12 1 1 1 ev_rx(\"100 then 50 q 24 after 12\") #> Events: #> time amt ii addl cmt evid #> 1 0 100 0 0 1 1 #> 2 12 50 24 0 1 1 ev_rx(\"100.2E-2 q4\") #> Events: #> time amt ii cmt evid #> 1 0 1.002 4 1 1 ev_rx(\"100 over 2.23\") #> Events: #> time amt rate cmt evid #> 1 0 100 44.84305 1 1 ev_rx(\"100 q 12 x 3\") #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 2 1 1 ev_rx(\"100 in 1 & 200 in 2\") #> Events: #> time amt cmt evid #> 1 0 100 1 1 #> 2 0 200 2 1 parse_rx(\"100 mg q 24 then 200 mg q12\") #> [[1]] #> [[1]]$time #> [1] 0 #> #> [[1]]$cmt #> [1] 1 #> #> [[1]]$amt #> [1] 100 #> #> [[1]]$ii #> [1] 24 #> #> #> [[2]] #> [[2]]$time #> [1] 0 #> #> [[2]]$cmt #> [1] 1 #> #> [[2]]$amt #> [1] 200 #> #> [[2]]$ii #> [1] 12 #> #>"},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":null,"dir":"Reference","previous_headings":"","what":"Schedule a series of event objects — ev_seq","title":"Schedule a series of event objects — ev_seq","text":"Use function want schedule two event objects time according dosing interval (ii) additional doses (addl).","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Schedule a series of event objects — ev_seq","text":"","code":"ev_seq(..., ID = NULL, .dots = NULL, id = NULL) # S3 method for class 'ev' seq(...)"},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Schedule a series of event objects — ev_seq","text":"... event objects numeric arguments named wait ii implement period -dosing activity sequence (see Details). ID numeric vector subject IDs. .dots list event objects replaces .... id deprecated; use ID.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Schedule a series of event objects — ev_seq","text":"single event object sorted time.","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Schedule a series of event objects — ev_seq","text":"Use generic seq() first argument event object. waiting period (wait ii) first event, need use ev_seq(). event object multiple rows, end time sequence taken one dosing interval event takes place last row event object. doses next event line start doses previous event line plus one dosing interval previous event line (see Examples). numerics named wait ii mixed event objects, period dosing activity incorporated sequence, adjacent dosing event objects. wait ii accomplish similar result, differ starting point inactive period. Use wait schedule next dose relative end dosing interval previous dose. Use ii schedule next dose relative time previous dose. wait acts like similar event object, starting waiting period one dosing interval last dose ii starts waiting period time last dose . wait ii can accomplish identical behavior depending whether last dosing interval included () value. Values wait ii can negative. NOTE: .ii available historically undocumented feature. Starting mrgsolve version 0.11.3, argument called ii. now, ii .ii accepted get deprecation warning use .ii. Please use ii instead. Values time event object act like prefix time spacer wherever event occurs event sequence (see Examples).","code":""},{"path":"https://mrgsolve.org/docs/reference/ev_seq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Schedule a series of event objects — ev_seq","text":"","code":"e1 <- ev(amt = 100, ii = 12, addl = 1) e2 <- ev(amt = 200) seq(e1, e2) #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 1 1 1 #> 2 24 200 0 0 1 1 seq(e1, ii = 8, e2) #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 1 1 1 #> 2 20 200 0 0 1 1 seq(e1, wait = 8, e2) #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 1 1 1 #> 2 32 200 0 0 1 1 seq(e1, ii = 8, e2, ID = seq(10)) #> Events: #> ID time amt ii addl cmt evid #> 1 1 0 100 12 1 1 1 #> 2 2 0 100 12 1 1 1 #> 3 3 0 100 12 1 1 1 #> 4 4 0 100 12 1 1 1 #> 5 5 0 100 12 1 1 1 #> 6 6 0 100 12 1 1 1 #> 7 7 0 100 12 1 1 1 #> 8 8 0 100 12 1 1 1 #> 9 9 0 100 12 1 1 1 #> 10 10 0 100 12 1 1 1 #> 11 1 20 200 0 0 1 1 #> 12 2 20 200 0 0 1 1 #> 13 3 20 200 0 0 1 1 #> 14 4 20 200 0 0 1 1 #> 15 5 20 200 0 0 1 1 #> 16 6 20 200 0 0 1 1 #> 17 7 20 200 0 0 1 1 #> 18 8 20 200 0 0 1 1 #> 19 9 20 200 0 0 1 1 #> 20 10 20 200 0 0 1 1 ev_seq(ii = 12, e1, ii = 120, e2, ii = 120, e1) #> Events: #> time amt ii addl cmt evid #> 1 12 100 12 1 1 1 #> 2 144 200 0 0 1 1 #> 3 264 100 12 1 1 1 seq(ev(amt = 100, ii = 12), ev(time = 8, amt = 200)) #> Events: #> time amt ii addl cmt evid #> 1 0 100 12 0 1 1 #> 2 20 200 0 0 1 1"},{"path":"https://mrgsolve.org/docs/reference/evd.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an event object with data-like names — evd","title":"Create an event object with data-like names — evd","text":"function calls ev() create event object sets case attribute renders nmtran data names upper case. object created evd() can used way object created ev().","code":""},{"path":"https://mrgsolve.org/docs/reference/evd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an event object with data-like names — evd","text":"","code":"evd(x, ...) # S4 method for class 'mrgmod' evd(x, ...) # S4 method for class 'missing' evd(x, ...) # S4 method for class 'ev' evd(x, ...) as.evd(x)"},{"path":"https://mrgsolve.org/docs/reference/evd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an event object with data-like names — evd","text":"x event object. ... arguments passed ev().","code":""},{"path":"https://mrgsolve.org/docs/reference/evd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create an event object with data-like names — evd","text":"Note evd separate class; just ev object specific case attribute. See examples illustrate difference.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/evd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create an event object with data-like names — evd","text":"","code":"a <- evd(amt = 100) b <- ev(amt = 300) a #> Events Data: #> time amt cmt evid #> 1 0 100 1 1 as.data.frame(a) #> TIME AMT CMT EVID #> 1 0 100 1 1 as_data_set(a, b) #> ID TIME AMT CMT EVID #> 1 1 0 100 1 1 #> 2 2 0 300 1 1 as_data_set(b, a) #> ID time amt cmt evid #> 1 1 0 300 1 1 #> 2 2 0 100 1 1 as.data.frame(seq(a, b)) #> TIME AMT II ADDL CMT EVID #> 1 0 100 0 0 1 1 #> 2 0 300 0 0 1 1"},{"path":"https://mrgsolve.org/docs/reference/exdatasets.html","id":null,"dir":"Reference","previous_headings":"","what":"Example input data sets — exdatasets","title":"Example input data sets — exdatasets","text":"Example input data sets","code":""},{"path":"https://mrgsolve.org/docs/reference/exdatasets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example input data sets — exdatasets","text":"","code":"data(exidata) data(extran1) data(extran2) data(extran3) data(exTheoph) data(exBoot)"},{"path":"https://mrgsolve.org/docs/reference/exdatasets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Example input data sets — exdatasets","text":"exidata holds individual-level parameters data items, one per row extran1 \"condensed\" data set extran2 full dataset extran3 full dataset parameters exTheoph theophylline data set, ready input mrgsolve exBoot set bootstrap parameter estimates","code":""},{"path":"https://mrgsolve.org/docs/reference/exdatasets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example input data sets — exdatasets","text":"","code":"mod <- mrgsolve::house() %>% update(end=240) %>% Req(CP) ## Full data set data(exTheoph) out <- mod %>% data_set(exTheoph) %>% mrgsim out #> Model: housemodel #> Dim: 132 x 3 #> Time: 0 to 24.65 #> ID: 12 #> ID time CP #> 1: 1 0.00 0.00000 #> 2: 1 0.25 0.04552 #> 3: 1 0.57 0.08624 #> 4: 1 1.12 0.12643 #> 5: 1 2.02 0.15072 #> 6: 1 3.82 0.15121 #> 7: 1 5.10 0.14348 #> 8: 1 7.03 0.13101 plot(out) ## Condensed: mrgsolve fills in the observations data(extran1) out <- mod %>% data_set(extran1) %>% mrgsim out #> Model: housemodel #> Dim: 4814 x 3 #> Time: 0 to 240 #> ID: 5 #> ID time CP #> 1: 1 0.00 0.00 #> 2: 1 0.00 0.00 #> 3: 1 0.25 12.87 #> 4: 1 0.50 22.25 #> 5: 1 0.75 29.04 #> 6: 1 1.00 33.91 #> 7: 1 1.25 37.37 #> 8: 1 1.50 39.78 plot(out) ## Add a parameter to the data set stopifnot(require(dplyr)) #> Loading required package: dplyr #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union data <- extran1 %>% distinct(ID) %>% select(ID) %>% mutate(CL=exp(log(1.5) + rnorm(nrow(.), 0,sqrt(0.1)))) %>% left_join(extran1,.) #> Joining with `by = join_by(ID)` data #> ID amt cmt time addl ii rate evid CL #> 1 1 1000 1 0 3 24 0 1 1.886905 #> 2 2 1000 2 0 0 0 20 1 1.204990 #> 3 3 1000 1 0 0 0 0 1 1.188595 #> 4 3 500 1 24 0 0 0 1 1.188595 #> 5 3 500 1 48 0 0 0 1 1.188595 #> 6 3 1000 1 72 0 0 0 1 1.188595 #> 7 4 2000 2 0 2 48 100 1 1.410414 #> 8 5 1000 1 0 0 0 0 1 1.758440 #> 9 5 5000 1 24 0 0 60 1 1.758440 out <- mod %>% data_set(data) %>% carry_out(CL) %>% mrgsim out #> Model: housemodel #> Dim: 4814 x 4 #> Time: 0 to 240 #> ID: 5 #> ID time CL CP #> 1: 1 0.00 1.887 0.00 #> 2: 1 0.00 1.887 0.00 #> 3: 1 0.25 1.887 12.80 #> 4: 1 0.50 1.887 21.98 #> 5: 1 0.75 1.887 28.50 #> 6: 1 1.00 1.887 33.04 #> 7: 1 1.25 1.887 36.12 #> 8: 1 1.50 1.887 38.14 plot(out) ## idata data(exidata) out <- mod %>% idata_set(exidata) %>% ev(amt=100,ii=24,addl=10) %>% mrgsim plot(out, CP~time|ID)"},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":null,"dir":"Reference","previous_headings":"","what":"Create template data sets for simulation — expand.idata","title":"Create template data sets for simulation — expand.idata","text":"functions expand combinations arguments using expand.grid(). expand.idata() generates idata set; others generate full data set. result always one row one individual. Use expand.evd() evd_expand() render NMTRAN names (e.g. AMT CMT) upper case.","code":""},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create template data sets for simulation — expand.idata","text":"","code":"expand.idata(...) expand.ev(...) expand.evd(...) ev_expand(...) evd_expand(...)"},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create template data sets for simulation — expand.idata","text":"... passed expand.grid().","code":""},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create template data sets for simulation — expand.idata","text":"data frame containing one row combination items passed .... result always ID set row number.","code":""},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create template data sets for simulation — expand.idata","text":"ID column added supplied user. output data frame, ID always re-written row number. expand.ev(), defaults also added include cmt = 1, time = 0, evid = 1. total included, addl derived total-1. tinf included, infusion rate derived row tinf greater zero. ev_expand() synonym expand.ev() evd_expand() synonym expand.evd().","code":""},{"path":"https://mrgsolve.org/docs/reference/expand.idata.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create template data sets for simulation — expand.idata","text":"","code":"idata <- expand.idata(CL = c(1,2,3), VC = c(10,20,30)) doses <- expand.ev(amt = c(300,100), ii = c(12,24), cmt = 1) infusion <- expand.ev(amt = 100, tinf = 2)"},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":null,"dir":"Reference","previous_headings":"","what":"Insert observations into a data set — expand_observations","title":"Insert observations into a data set — expand_observations","text":"Insert observations data set","code":""},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Insert observations into a data set — expand_observations","text":"","code":"expand_observations(data, times, unique = FALSE, obs_pos = -1L)"},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Insert observations into a data set — expand_observations","text":"data data set event object. times vector observation times. unique logical; TRUE values time dropped found anywhere data. obs_pos determines sorting order observations; use -1 (default) put observations first; otherwise, use large integer ensure observations placed doses.","code":""},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Insert observations into a data set — expand_observations","text":"data frame additional rows added observation records.","code":""},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Insert observations into a data set — expand_observations","text":"Non-numeric columns dropped warning.","code":""},{"path":"https://mrgsolve.org/docs/reference/expand_observations.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Insert observations into a data set — expand_observations","text":"","code":"data <- expand.ev(amt = c(100, 200, 300)) expand_observations(data, times = seq(0, 48, 2)) #> ID time amt cmt evid #> 1 1 0 0 0 0 #> 2 1 0 100 1 1 #> 3 1 2 0 0 0 #> 4 1 4 0 0 0 #> 5 1 6 0 0 0 #> 6 1 8 0 0 0 #> 7 1 10 0 0 0 #> 8 1 12 0 0 0 #> 9 1 14 0 0 0 #> 10 1 16 0 0 0 #> 11 1 18 0 0 0 #> 12 1 20 0 0 0 #> 13 1 22 0 0 0 #> 14 1 24 0 0 0 #> 15 1 26 0 0 0 #> 16 1 28 0 0 0 #> 17 1 30 0 0 0 #> 18 1 32 0 0 0 #> 19 1 34 0 0 0 #> 20 1 36 0 0 0 #> 21 1 38 0 0 0 #> 22 1 40 0 0 0 #> 23 1 42 0 0 0 #> 24 1 44 0 0 0 #> 25 1 46 0 0 0 #> 26 1 48 0 0 0 #> 27 2 0 0 0 0 #> 28 2 0 200 1 1 #> 29 2 2 0 0 0 #> 30 2 4 0 0 0 #> 31 2 6 0 0 0 #> 32 2 8 0 0 0 #> 33 2 10 0 0 0 #> 34 2 12 0 0 0 #> 35 2 14 0 0 0 #> 36 2 16 0 0 0 #> 37 2 18 0 0 0 #> 38 2 20 0 0 0 #> 39 2 22 0 0 0 #> 40 2 24 0 0 0 #> 41 2 26 0 0 0 #> 42 2 28 0 0 0 #> 43 2 30 0 0 0 #> 44 2 32 0 0 0 #> 45 2 34 0 0 0 #> 46 2 36 0 0 0 #> 47 2 38 0 0 0 #> 48 2 40 0 0 0 #> 49 2 42 0 0 0 #> 50 2 44 0 0 0 #> 51 2 46 0 0 0 #> 52 2 48 0 0 0 #> 53 3 0 0 0 0 #> 54 3 0 300 1 1 #> 55 3 2 0 0 0 #> 56 3 4 0 0 0 #> 57 3 6 0 0 0 #> 58 3 8 0 0 0 #> 59 3 10 0 0 0 #> 60 3 12 0 0 0 #> 61 3 14 0 0 0 #> 62 3 16 0 0 0 #> 63 3 18 0 0 0 #> 64 3 20 0 0 0 #> 65 3 22 0 0 0 #> 66 3 24 0 0 0 #> 67 3 26 0 0 0 #> 68 3 28 0 0 0 #> 69 3 30 0 0 0 #> 70 3 32 0 0 0 #> 71 3 34 0 0 0 #> 72 3 36 0 0 0 #> 73 3 38 0 0 0 #> 74 3 40 0 0 0 #> 75 3 42 0 0 0 #> 76 3 44 0 0 0 #> 77 3 46 0 0 0 #> 78 3 48 0 0 0"},{"path":"https://mrgsolve.org/docs/reference/file_show.html","id":null,"dir":"Reference","previous_headings":"","what":"Show model specification and C++ files — file_show","title":"Show model specification and C++ files — file_show","text":"Show model specification C++ files","code":""},{"path":"https://mrgsolve.org/docs/reference/file_show.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show model specification and C++ files — file_show","text":"","code":"file_show(x, spec = TRUE, source = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/file_show.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show model specification and C++ files — file_show","text":"x model object spec logical; show model specification file source logical; show C++ file actually compiled ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/get_tol.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract rtol and atol information from a model object — get_tol","title":"Extract rtol and atol information from a model object — get_tol","text":"Extract rtol atol information model object","code":""},{"path":"https://mrgsolve.org/docs/reference/get_tol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract rtol and atol information from a model object — get_tol","text":"","code":"get_tol(x) get_tol_list(x)"},{"path":"https://mrgsolve.org/docs/reference/get_tol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract rtol and atol information from a model object — get_tol","text":"x model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/get_tol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract rtol and atol information from a model object — get_tol","text":"data frame (get_tol()) named list (get_tol_list()).","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/get_tol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract rtol and atol information from a model object — get_tol","text":"","code":"mod <- house() get_tol(mod) #> cmt custom_rtol custom_atol scalar_rtol scalar_atol #> 1 GUT NA NA 1e-08 1e-08 #> 2 CENT NA NA 1e-08 1e-08 #> 3 RESP NA NA 1e-08 1e-08 get_tol_list(mod) #> $custom_rtol #> $custom_rtol$GUT #> [1] NA #> #> $custom_rtol$CENT #> [1] NA #> #> $custom_rtol$RESP #> [1] NA #> #> #> $custom_atol #> $custom_atol$GUT #> [1] NA #> #> $custom_atol$CENT #> [1] NA #> #> $custom_atol$RESP #> [1] NA #> #> #> $scalar_rtol #> $scalar_rtol$GUT #> [1] 1e-08 #> #> $scalar_rtol$CENT #> [1] 1e-08 #> #> $scalar_rtol$RESP #> [1] 1e-08 #> #> #> $scalar_atol #> $scalar_atol$GUT #> [1] 1e-08 #> #> $scalar_atol$CENT #> [1] 1e-08 #> #> $scalar_atol$RESP #> [1] 1e-08 #> #>"},{"path":"https://mrgsolve.org/docs/reference/house.html","id":null,"dir":"Reference","previous_headings":"","what":"Return a pre-compiled, PK/PD model — house","title":"Return a pre-compiled, PK/PD model — house","text":"model used lot package tests, can useful support user experimentation well.","code":""},{"path":"https://mrgsolve.org/docs/reference/house.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return a pre-compiled, PK/PD model — house","text":"","code":"house(...)"},{"path":"https://mrgsolve.org/docs/reference/house.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return a pre-compiled, PK/PD model — house","text":"... passed update().","code":""},{"path":"https://mrgsolve.org/docs/reference/house.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return a pre-compiled, PK/PD model — house","text":"packmod object, ready simulate.","code":""},{"path":"https://mrgsolve.org/docs/reference/house.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return a pre-compiled, PK/PD model — house","text":"","code":"mod <- mrgsolve::house() see(mod) #> #> Model file: housemodel.cpp #> $PROB #> #> # `mrgsolve` housemodel #> #> This model is compiled with `mrgsolve`. #> #> - Author: Metrum Research Group, LLC #> - Description: Generic indirect response PK/PD model #> - Covariates: Weight, female sex #> - Random effects: CL, VC, KA, KOUT #> - Error model: exponential #> #> #> #> $PLUGIN base #> #> $PARAM @annotated #> CL : 1 : Clearance (L/hr) #> VC : 20 : Volume of distribution (L) #> KA : 1.2 : Absorption rate constant (1/hr) #> F1 : 1.0 : Bioavailability fraction (.) #> D1 : 2.0 : Infusion duration (hr) #> WTCL : 0.75 : Exponent WT on CL #> WTVC : 1.00 : Exponent WT on VC #> SEXCL: 0.7 : Prop cov effect on CL #> SEXVC: 0.85 : Prop cov effect on VC #> KIN : 100 : Resp prod rate constant (1/hr) #> KOUT : 2 : Resp elim rate constant (1/hr) #> IC50 : 10 : Conc giving 50% max resp (ng/ml) #> #> $PARAM @annotated @covariates #> WT : 70 : Weight (kg) #> SEX : 0 : Covariate female sex #> #> $CMT @annotated #> GUT : Dosing compartment (mg) #> CENT : Central compartment (mg) #> RESP : Response (unitless) #> #> $OMEGA @labels ECL EVC EKA EKOUT #> 0 0 0 0 #> #> $SIGMA @labels EXPO #> 0 #> #> $SET end=120, delta=0.25 #> #> $GLOBAL #> #define CP (CENT/VCi) #> #define INH (CP/(IC50+CP)) #> #> typedef double localdouble; #> #> $MAIN #> F_GUT = F1; #> D_CENT = D1; #> #> double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL); #> double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC); #> double KAi = exp(log(KA) + EKA); #> double KOUTi = exp(log(KOUT) + EKOUT); #> #> RESP_0 = KIN/KOUTi; #> #> $ODE #> dxdt_GUT = -KAi*GUT; #> dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT; #> dxdt_RESP = KIN*(1-INH) - KOUTi*RESP; #> #> $TABLE #> double DV = CP*exp(EXPO); #> #> $CAPTURE @annotated #> DV: Dependent variable (ng/ml) #> CP: Plasma concentration (ng/ml) mod %>% ev(amt = 100) %>% mrgsim() %>% plot()"},{"path":"https://mrgsolve.org/docs/reference/idata_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Select and modify a idata set for simulation — idata_set","title":"Select and modify a idata set for simulation — idata_set","text":"individual data set (idata_set) data frame one row individual population, specifying parameters individual-level data.","code":""},{"path":"https://mrgsolve.org/docs/reference/idata_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select and modify a idata set for simulation — idata_set","text":"","code":"idata_set(x, data, ...) # S4 method for class 'mrgmod,data.frame' idata_set( x, data, .subset = TRUE, .select = TRUE, object = NULL, need = NULL, ... ) # S4 method for class 'mrgmod,ANY' idata_set(x, data, ...) # S4 method for class 'mrgmod,missing' idata_set(x, object, ...)"},{"path":"https://mrgsolve.org/docs/reference/idata_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select and modify a idata set for simulation — idata_set","text":"x model object. data data set can coerced data.frame. ... arguments passed along object function. .subset unquoted expression passed dplyr::filter(); retain certain rows data set. .select passed dplyr::select(); retain certain columns data set; result call dplyr::vars(). object character name object existing $ENV use data set. need passed inventory().","code":""},{"path":"https://mrgsolve.org/docs/reference/idata_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select and modify a idata set for simulation — idata_set","text":"idata_set data frame specifies individual-level data problem. ID column required can one row data frame individual. cases, columns idata_set names parameters param() list. case, parameter set updated simulation proceeds start individual. idata_set can also used set initial conditions individual: compartment called CMT, make column idata_set called CMT_0 make value desired initial value compartment. Note initial condition overridden also set CMT_0 $MAIN ($PK). common application idata_set specify population batch simulations . commonly use idata_set event object (see ev()). case, event gets applied individual idata_set. also possible provide data_set idata_set. case, idata_set used parameter lookup IDs found data_set. Remember case, data_set (idata_set) determines number individuals simulation. error generated parameter columns input idata set contain NA.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/idata_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select and modify a idata set for simulation — idata_set","text":"","code":"mod <- mrgsolve::house() data(exidata) exidata #> ID CL VC KA KOUT IC50 FOO #> 1 1 1.050 47.80 0.8390 2.450 1.280 4 #> 2 2 0.730 30.10 0.0684 2.510 1.840 6 #> 3 3 2.820 23.80 0.1180 3.880 2.480 5 #> 4 4 0.552 26.30 0.4950 1.180 0.977 2 #> 5 5 0.483 4.36 0.1220 2.350 0.483 10 #> 6 6 3.620 39.80 0.1260 1.890 4.240 1 #> 7 7 0.395 12.10 0.0317 1.250 0.802 8 #> 8 8 1.440 31.20 0.0931 4.030 1.310 7 #> 9 9 2.570 18.20 0.0570 0.862 1.950 3 #> 10 10 2.000 6.51 0.1540 3.220 0.699 9 mod %>% idata_set(exidata, ID <= 2) %>% ev(amt = 100) %>% mrgsim() %>% plot() mod %>% idata_set(exidata) %>% ev(amt = 100) %>% mrgsim() #> Model: housemodel #> Dim: 4820 x 7 #> Time: 0 to 120 #> ID: 10 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.00 0.00 40.82 0.0000 0.0000 #> 2: 1 0.00 100.00 0.00 40.82 0.0000 0.0000 #> 3: 1 0.25 81.08 18.87 38.12 0.3947 0.3947 #> 4: 1 0.50 65.74 34.06 33.59 0.7126 0.7126 #> 5: 1 0.75 53.30 46.28 29.41 0.9682 0.9682 #> 6: 1 1.00 43.21 56.08 26.06 1.1733 1.1733 #> 7: 1 1.25 35.04 63.93 23.53 1.3374 1.3374 #> 8: 1 1.50 28.41 70.19 21.64 1.4684 1.4684 mod %>% ev(amt = 100) %>% mrgsim(idata=exidata) #> Model: housemodel #> Dim: 4820 x 7 #> Time: 0 to 120 #> ID: 10 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.00 0.00 40.82 0.0000 0.0000 #> 2: 1 0.00 100.00 0.00 40.82 0.0000 0.0000 #> 3: 1 0.25 81.08 18.87 38.12 0.3947 0.3947 #> 4: 1 0.50 65.74 34.06 33.59 0.7126 0.7126 #> 5: 1 0.75 53.30 46.28 29.41 0.9682 0.9682 #> 6: 1 1.00 43.21 56.08 26.06 1.1733 1.1733 #> 7: 1 1.25 35.04 63.93 23.53 1.3374 1.3374 #> 8: 1 1.50 28.41 70.19 21.64 1.4684 1.4684"},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":null,"dir":"Reference","previous_headings":"","what":"Check whether all required parameters needed in a model are present in an object — inventory","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"function largely superseded check_data_names().","code":""},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"","code":"inventory(x, obj, ..., .strict = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"x model object. obj data.frame pass idata_set() data_set(). ... capture dplyr-style parameter requirements. .strict whether stop execution requirements present (TRUE) just warn (FALSE); see Details.","code":""},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"x returned invisibly.","code":""},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"parameter requirements explicitly stated, requirement defaults parameter names x. Note , default, inventory .strict unless user explicitly states parameter requirement. , parameter requirements explicitly stated, .strict set TRUE value .strict passed call.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/inventory.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check whether all required parameters needed in a model are present in an object — inventory","text":"","code":"if (FALSE) { # \\dontrun{ inventory(mod, idata, CL:V) # parameters defined, inclusively, CL through Volume inventory(mod, idata, everything()) # all parameters inventory(mod, idata, contains(\"OCC\")) # all parameters containing OCC inventory(mod, idata, -F) # all parameters except F } # }"},{"path":"https://mrgsolve.org/docs/reference/is.mrgmod.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a model object — is.mrgmod","title":"Check if an object is a model object — is.mrgmod","text":"function checks see object either mrgmod packmod.","code":""},{"path":"https://mrgsolve.org/docs/reference/is.mrgmod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a model object — is.mrgmod","text":"","code":"is.mrgmod(x)"},{"path":"https://mrgsolve.org/docs/reference/is.mrgmod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a model object — is.mrgmod","text":"x object","code":""},{"path":"https://mrgsolve.org/docs/reference/is.mrgmod.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a model object — is.mrgmod","text":"TRUE object inherits either mrgmod packmod class.","code":""},{"path":"https://mrgsolve.org/docs/reference/is.mrgmod.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if an object is a model object — is.mrgmod","text":"","code":"mod <- mrgsolve::house() is.mrgmod(mod) #> [1] TRUE"},{"path":"https://mrgsolve.org/docs/reference/is.mrgsims.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is mrgsims output — is.mrgsims","title":"Check if an object is mrgsims output — is.mrgsims","text":"Check object mrgsims output","code":""},{"path":"https://mrgsolve.org/docs/reference/is.mrgsims.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is mrgsims output — is.mrgsims","text":"","code":"is.mrgsims(x)"},{"path":"https://mrgsolve.org/docs/reference/is.mrgsims.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is mrgsims output — is.mrgsims","text":"x object.","code":""},{"path":"https://mrgsolve.org/docs/reference/is.mrgsims.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is mrgsims output — is.mrgsims","text":"TRUE x inherits mrgsims.","code":""},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":null,"dir":"Reference","previous_headings":"","what":"Run sensitivity analysis on model settings — knobs","title":"Run sensitivity analysis on model settings — knobs","text":"Knobs can parameter values PK dosing items (e.g. amt). design, combinations specified knob/values simulated.","code":""},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run sensitivity analysis on model settings — knobs","text":"","code":"knobs(x, y, ...) # S4 method for class 'mrgmod,missing' knobs(x, y, ...) # S4 method for class 'mrgmod,batch_mrgsims' knobs(x, y, ...) # S4 method for class 'batch_mrgsims' as.data.frame(x, row.names = NULL, optional = FALSE, ...) # S4 method for class 'batch_mrgsims,ANY' knobs(x, y, ...) # S4 method for class 'batch_mrgsims' show(object)"},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run sensitivity analysis on model settings — knobs","text":"x model object y batch_mrgsims object ... knobs: named numeric vectors identify knob names knob values batch run. See details. row.names passed .data.frame.data.frame optional passed .data.frame.data.frame object object show","code":""},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run sensitivity analysis on model settings — knobs","text":"object class batch_mrgsims. methods mrgsims objects also work batch_mrgsims object.","code":""},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run sensitivity analysis on model settings — knobs","text":"Valid knob names include: parameter name (param(mod)), time variables (start, end, delta), PK dosing items (amt, ii, rate, others ...), solver settings (atol, hmax, etc...).","code":""},{"path":"https://mrgsolve.org/docs/reference/knobs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run sensitivity analysis on model settings — knobs","text":"","code":"## example(\"knobs\") mod <- mrgsolve::house(end=72) events <- ev(amt=1000, cmt=1, addl=3, ii=12) out <- mod %>% ev(events) %>% knobs(CL=c(1,2,3)) plot(out) out #> Model: housemodel #> Batch (head): #> ID CL #> 1 1 1 #> 2 2 2 #> 3 3 3 #> [ CL ] #> #> Head: #> ID time GUT CENT RESP DV CP CL #> 1 1 0.00 1000.0000 0.0000 50.00000 0.00000 0.00000 1 #> 2 1 0.25 740.8182 257.4883 42.29342 12.87441 12.87441 1 #> 3 1 0.50 548.8116 445.0417 32.69422 22.25208 22.25208 1 #> 4 1 0.75 406.5697 580.8258 25.29397 29.04129 29.04129 1 #> 5 1 1.00 301.1942 678.2976 20.05159 33.91488 33.91488 1 #> [ CL ] out <- mod %>% ev(events) %>% knobs(CL=c(1,2,3), VC=c(5,20,50)) plot(out) plot(out,CP~.) plot(out, CP~time|VC, groups=CL, lty=2) out <- knobs(mod, amt=c(100,300,500), cmt=1) plot(out) out <- mod %>% knobs(amt=c(100,300), CL=c(1,3), VC=c(5,20), cmt=1) plot(out) #> Dropping knobs: VC plot(out, CP~.) out <- knobs(mod, CL=c(1,2,3)) out #> Model: housemodel #> Batch (head): #> ID CL #> 1 1 1 #> 2 2 2 #> 3 3 3 #> [ CL ] #> #> Head: #> ID time GUT CENT RESP DV CP CL #> 1 1 0.00 0 0 50 0 0 1 #> 2 1 0.25 0 0 50 0 0 1 #> 3 1 0.50 0 0 50 0 0 1 #> 4 1 0.75 0 0 50 0 0 1 #> 5 1 1.00 0 0 50 0 0 1 #> [ CL ] out <- knobs(mod, CL=c(1,2,3)) out #> Model: housemodel #> Batch (head): #> ID CL #> 1 1 1 #> 2 2 2 #> 3 3 3 #> [ CL ] #> #> Head: #> ID time GUT CENT RESP DV CP CL #> 1 1 0.00 0 0 50 0 0 1 #> 2 1 0.25 0 0 50 0 0 1 #> 3 1 0.50 0 0 50 0 0 1 #> 4 1 0.75 0 0 50 0 0 1 #> 5 1 1.00 0 0 50 0 0 1 #> [ CL ]"},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":null,"dir":"Reference","previous_headings":"","what":"Change the case of nmtran-like data items — lctran","title":"Change the case of nmtran-like data items — lctran","text":"Previous data set requirements included lower case names data items like AMT EVID. Lower case longer required. However, still requirement nmtran like data column names either lower case upper case.","code":""},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change the case of nmtran-like data items — lctran","text":"","code":"lctran(data, ...) # S3 method for class 'data.frame' lctran(data, warn = TRUE, ...) # S3 method for class 'ev' lctran(data, ...) uctran(data, ...) # S3 method for class 'data.frame' uctran(data, warn = TRUE, ...) # S3 method for class 'ev' uctran(data, ...)"},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change the case of nmtran-like data items — lctran","text":"data data set nmtran-like format event object. ... potential future use. warn TRUE, warning issued upper lower case versions nmtran-like column data frame.","code":""},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change the case of nmtran-like data items — lctran","text":"data frame event object, column names possibly converted upper lower case.","code":""},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Change the case of nmtran-like data items — lctran","text":"Columns renamed lower upper case versions: AMT / amt II / ii SS / ss CMT / cmt ADDL / addl RATE / rate EVID / evid TIME / time lower upper case versions name present data frame, changes made.","code":""},{"path":"https://mrgsolve.org/docs/reference/lctran.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change the case of nmtran-like data items — lctran","text":"","code":"data <- data.frame(TIME = 0, AMT = 5, II = 24, addl = 2, WT = 80) lctran(data) #> time amt ii addl WT #> 1 0 5 24 2 80 data <- data.frame(TIME = 0, AMT = 5, II = 24, addl = 2, wt = 80) uctran(data) #> TIME AMT II ADDL wt #> 1 0 5 24 2 80 ev <- evd(amt = 100, evid = 3) uctran(ev) #> Events Data: #> time amt cmt evid #> 1 0 100 1 3 # warning data <- data.frame(TIME = 1, time = 2, CMT = 5) lctran(data) #> Warning: There are both upper and lower case versions of some nmtran names in the data set #> TIME time cmt #> 1 1 2 5"},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the model shared object — loadso","title":"Load the model shared object — loadso","text":"model compiled, model object can used re-load model shared object (compiled code underlying mode) simulation done different R process.","code":""},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load the model shared object — loadso","text":"","code":"loadso(x, ...) # S3 method for class 'mrgmod' loadso(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the model shared object — loadso","text":"x model object. ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the model shared object — loadso","text":"model object (invisibly).","code":""},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Load the model shared object — loadso","text":"loadso function frequently needs used parallelizing simulations across worker nodes. model can run calling loadso, without requiring re-compiled worker nodes. likely required model built (shared object stored) local directory working R directory (see second example).","code":""},{"path":"https://mrgsolve.org/docs/reference/loadso.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load the model shared object — loadso","text":"","code":"if (FALSE) { # \\dontrun{ mod <- mread(\"pk1\", modlib()) loadso(mod) mod2 <- mread(\"pk2\", modlib(), soloc = \"build\") loadso(mod2) } # }"},{"path":"https://mrgsolve.org/docs/reference/lower2matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a square numeric matrix from the lower-triangular elements — lower2matrix","title":"Create a square numeric matrix from the lower-triangular elements — lower2matrix","text":"Create square numeric matrix lower-triangular elements","code":""},{"path":"https://mrgsolve.org/docs/reference/lower2matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a square numeric matrix from the lower-triangular elements — lower2matrix","text":"","code":"lower2matrix(x, context = NULL)"},{"path":"https://mrgsolve.org/docs/reference/lower2matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a square numeric matrix from the lower-triangular elements — lower2matrix","text":"x numeric data context working context","code":""},{"path":"https://mrgsolve.org/docs/reference/lower2matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a square numeric matrix from the lower-triangular elements — lower2matrix","text":"square symmetric numeric matrix column names","code":""},{"path":"https://mrgsolve.org/docs/reference/matlist-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class matlist — matlist-class","title":"S4 class matlist — matlist-class","text":"S4 class matlist","code":""},{"path":"https://mrgsolve.org/docs/reference/matlist.html","id":null,"dir":"Reference","previous_headings":"","what":"Methods for working with matrix-list objects — matlist","title":"Methods for working with matrix-list objects — matlist","text":"Methods working matrix-list objects","code":""},{"path":"https://mrgsolve.org/docs/reference/matlist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Methods for working with matrix-list objects — matlist","text":"","code":"# S4 method for class 'matlist' as.list(x, detailed = FALSE, ...) # S4 method for class 'matlist' as.matrix(x, ...) # S3 method for class 'matlist' names(x) # S3 method for class 'matlist' length(x) # S4 method for class 'matlist' labels(object, ...) # S4 method for class 'matlist' dim(x) # S4 method for class 'matlist' nrow(x) # S4 method for class 'matlist' show(object)"},{"path":"https://mrgsolve.org/docs/reference/matlist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Methods for working with matrix-list objects — matlist","text":"x matlist object. detailed TRUE, simple list matrices returned; otherwise, entire matlist object data returned along name class (e.g. either omegalist sigmalist) well names matrices. ... passed methods. object passed showmatlist","code":""},{"path":"https://mrgsolve.org/docs/reference/matlist_ops.html","id":null,"dir":"Reference","previous_headings":"","what":"Operations with matlist objects — c,matlist-method","title":"Operations with matlist objects — c,matlist-method","text":"Operations matlist objects","code":""},{"path":"https://mrgsolve.org/docs/reference/matlist_ops.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Operations with matlist objects — c,matlist-method","text":"","code":"# S4 method for class 'matlist' c(x, ..., recursive = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/matlist_ops.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Operations with matlist objects — c,matlist-method","text":"x matlist object. ... matlist objects. recursive used.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce R objects to block or diagonal matrices — as_bmat","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"simple functions may helpful create matrix objects mrgsolve expects. Functions named based whether create diagonal matrix (d), block matrix (b), correlation matrix (c).","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"","code":"as_bmat(x, ...) # S4 method for class 'list' as_bmat(x, ...) # S4 method for class 'numeric' as_bmat(x, pat = \"*\", ...) # S4 method for class 'data.frame' as_bmat(x, pat = \"*\", cols = NULL, ...) # S4 method for class 'ANY' as_bmat(x, ...) as_dmat(x, ...) # S4 method for class 'list' as_dmat(x, ...) # S4 method for class 'ANY' as_dmat(x, ...) # S4 method for class 'numeric' as_dmat(x, pat = \"*\", ...) # S4 method for class 'data.frame' as_dmat(x, pat = \"*\", cols = NULL, ...) as_cmat(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"x data frame list. ... arguments passed dmat() cmat(). pat regular expression, character. cols column names use instead pat.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"numeric matrix list numeric methods. data.frames, list matrices returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"Use as_dmat() create diagonal matrix, as_bmat() create block matrix, as_cmat() create block matrix -diagonal elements understood correlations rather covariances. as_cmat() uses as_bmat() form matrix converts -diagonal elements covariances returning. methods data.frame work rows data frame make appropriate matrix data row. result list matrices.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/matrix_converters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce R objects to block or diagonal matrices — as_bmat","text":"","code":"df <- data.frame( OMEGA1.1 = c(1,2), OMEGA2.1 = c(11,22), OMEGA2.2 = c(3,4), SIGMA1.1 = 1, FOO=-1 ) as_bmat(df, \"OMEGA\") #> [[1]] #> [,1] [,2] #> [1,] 1 11 #> [2,] 11 3 #> #> [[2]] #> [,1] [,2] #> [1,] 2 22 #> [2,] 22 4 #> as_dmat(df,\"SIGMA\") #> [[1]] #> [,1] #> [1,] 1 #> #> [[2]] #> [,1] #> [1,] 1 #> as_dmat(df[1,],\"OMEGA\") #> [[1]] #> [,1] [,2] [,3] #> [1,] 1 0 0 #> [2,] 0 11 0 #> [3,] 0 0 3 #>"},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Create matrices from vector input — matrix_helpers","title":"Create matrices from vector input — matrix_helpers","text":"functions simple utilities creating diagonal, block correlation matrices.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create matrices from vector input — matrix_helpers","text":"","code":"bmat(..., correlation = FALSE, digits = -1) cmat(..., digits = -1) dmat(...)"},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create matrices from vector input — matrix_helpers","text":"... matrix data. correlation logical; TRUE, -diagonal elements assumed correlations converted covariances. digits greater zero, matrix passed signif() (along digits) prior returning.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create matrices from vector input — matrix_helpers","text":"matrix.","code":""},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create matrices from vector input — matrix_helpers","text":"bmat() makes block matrix. cmat() makes correlation matrix. dmat() makes diagonal matrix.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/matrix_helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create matrices from vector input — matrix_helpers","text":"","code":"dmat(1,2,3)/10 #> [,1] [,2] [,3] #> [1,] 0.1 0.0 0.0 #> [2,] 0.0 0.2 0.0 #> [3,] 0.0 0.0 0.3 bmat(0.5,0.01,0.2) #> [,1] [,2] #> [1,] 0.50 0.01 #> [2,] 0.01 0.20 cmat(0.5, 0.87,0.2) #> [,1] [,2] #> [1,] 0.5000000 0.2751182 #> [2,] 0.2751182 0.2000000"},{"path":"https://mrgsolve.org/docs/reference/mcRNG.html","id":null,"dir":"Reference","previous_headings":"","what":"Set RNG to use L'Ecuyer-CMRG — mcRNG","title":"Set RNG to use L'Ecuyer-CMRG — mcRNG","text":"Set RNG use L'Ecuyer-CMRG","code":""},{"path":"https://mrgsolve.org/docs/reference/mcRNG.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set RNG to use L'Ecuyer-CMRG — mcRNG","text":"","code":"mcRNG()"},{"path":"https://mrgsolve.org/docs/reference/mcode.html","id":null,"dir":"Reference","previous_headings":"","what":"Write, compile, and load model code — mcode","title":"Write, compile, and load model code — mcode","text":"convenience function ultimately calls mread(). Model code written file read back using mread().","code":""},{"path":"https://mrgsolve.org/docs/reference/mcode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write, compile, and load model code — mcode","text":"","code":"mcode(model, code, project = getOption(\"mrgsolve.project\", tempdir()), ...) mcode_cache( model, code, project = getOption(\"mrgsolve.project\", tempdir()), ... )"},{"path":"https://mrgsolve.org/docs/reference/mcode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write, compile, and load model code — mcode","text":"model model name. code character string specifying mrgsolve model. project project directory model. ... passed mread(); see help topic arguments can set.","code":""},{"path":"https://mrgsolve.org/docs/reference/mcode.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write, compile, and load model code — mcode","text":"Note arguments slightly different order mread(). default project tempdir(). See mread() help topic discussion caching compilation results mcode_cache().","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mcode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write, compile, and load model code — mcode","text":"","code":"if (FALSE) { # \\dontrun{ code <- ' $CMT DEPOT CENT $PKMODEL ncmt=1, depot=TRUE $MAIN double CL = 1; double V = 20; double KA = 1; ' mod <- mcode(\"example\", code, compile = FALSE) } # }"},{"path":"https://mrgsolve.org/docs/reference/merge.html","id":null,"dir":"Reference","previous_headings":"","what":"Merge two lists — merge.list","title":"Merge two lists — merge.list","text":"Merge two lists","code":""},{"path":"https://mrgsolve.org/docs/reference/merge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merge two lists — merge.list","text":"","code":"# S3 method for class 'list' merge(x, y, ..., open = FALSE, warn = TRUE, context = \"object\", wild = \"...\")"},{"path":"https://mrgsolve.org/docs/reference/merge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merge two lists — merge.list","text":"x original list y new list merging ... used open logical indicating whether new items allowed list upon merging warn issue warning nothing found update context description usage context wild wild-card name; see details","code":""},{"path":"https://mrgsolve.org/docs/reference/merge.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Merge two lists — merge.list","text":"Wild-card names (wild) always retained x brought along y open.","code":""},{"path":"https://mrgsolve.org/docs/reference/mod.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the model object — mod","title":"Return the model object — mod","text":"Return model object","code":""},{"path":"https://mrgsolve.org/docs/reference/mod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the model object — mod","text":"","code":"mod(x, ...) # S4 method for class 'mrgsims' mod(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/mod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the model object — mod","text":"x mrgsims object ... passed along","code":""},{"path":"https://mrgsolve.org/docs/reference/modMATRIX.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a matrix — modMATRIX","title":"Create a matrix — modMATRIX","text":"Create matrix","code":""},{"path":"https://mrgsolve.org/docs/reference/modMATRIX.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a matrix — modMATRIX","text":"","code":"modMATRIX( x, use = TRUE, block = FALSE, correlation = FALSE, digits = -1, context = \"matlist\", ... )"},{"path":"https://mrgsolve.org/docs/reference/modMATRIX.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a matrix — modMATRIX","text":"x data building matrix. Data x assumed -diagonal elements block FALSE lower-triangular elements block TRUE use logical; FALSE, matrix elements set 0 block logical; TRUE, try make block matrix; diagonal otherwise correlation logical; TRUE, diagonal elements assumed correlations converted covariances; correlation TRUE, block set TRUE digits value argument greater zero, matrix passed signif (along digits) prior returning context working context ... passed along","code":""},{"path":"https://mrgsolve.org/docs/reference/modMATRIX.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a matrix — modMATRIX","text":"","code":"modMATRIX(\"1 2.2 333\") #> [,1] [,2] [,3] #> [1,] 1 0.0 0 #> [2,] 0 2.2 0 #> [3,] 0 0.0 333 modMATRIX(\"1 1.1 2.2\", block=TRUE) #> [,1] [,2] #> [1,] 1.0 1.1 #> [2,] 1.1 2.2 modMATRIX(\"23 234 234 5234\", use=FALSE) #> [,1] [,2] [,3] [,4] #> [1,] 0 0 0 0 #> [2,] 0 0 0 0 #> [3,] 0 0 0 0 #> [4,] 0 0 0 0 ans <- modMATRIX(\"1.1 0.657 2.2\", correlation=TRUE, block=TRUE) ans #> [,1] [,2] #> [1,] 1.100000 1.022052 #> [2,] 1.022052 2.200000 cov2cor(ans) #> [,1] [,2] #> [1,] 1.000 0.657 #> [2,] 0.657 1.000"},{"path":"https://mrgsolve.org/docs/reference/modelparse.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse model specification text — modelparse","title":"Parse model specification text — modelparse","text":"Parse model specification text","code":""},{"path":"https://mrgsolve.org/docs/reference/modelparse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse model specification text — modelparse","text":"","code":"modelparse(txt, split = FALSE, drop_blank = TRUE, comment_re = c(\"//\", \"##\")) modelparse_rmd(txt, split = FALSE, drop_blank = TRUE, comment_re = \"//\")"},{"path":"https://mrgsolve.org/docs/reference/modelparse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse model specification text — modelparse","text":"txt model specification text split logical drop_blank logical; TRUE blank lines dropped comment_re regular expression comments","code":""},{"path":"https://mrgsolve.org/docs/reference/modelparse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Parse model specification text — modelparse","text":"","code":"file <- file.path(modlib(), \"pk1.cpp\") modelparse(readLines(file)) #> $PARAM #> [1] \"@annotated\" #> [2] \"CL : 1 : Clearance (volume/time)\" #> [3] \"V : 20 : Central volume (volume)\" #> [4] \"KA : 1 : Absorption rate constant (1/time)\" #> #> $CMT #> [1] \"@annotated\" \"EV : Extravascular compartment\" #> [3] \"CENT : Central compartment\" #> #> $GLOBAL #> [1] \"#define CP (CENT/V)\" #> #> $PKMODEL #> [1] \"ncmt = 1, depot = TRUE\" #> #> $CAPTURE #> [1] \"@annotated\" #> [2] \"CP : Plasma concentration (mass/volume)\" #>"},{"path":"https://mrgsolve.org/docs/reference/modlib.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal model library — modlib","title":"Internal model library — modlib","text":"Pre-coded models included mrgsolve installation; can compiled loaded modlib(). models usually useful exploratory simulation learning mrgsolve. Production simulation work typically accomplished custom-coded model.","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal model library — modlib","text":"","code":"modlib(model = NULL, ..., list = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/modlib.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal model library — modlib","text":"model character name model library. ... passed mread_cache(). list logical; TRUE, list available models returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Internal model library — modlib","text":"See modlib_details, modlib_pk, modlib_pkpd, modlib_tmdd, modlib_viral details. Call modlib(\"<modelname>\") compile load mode library. Call modlib(list=TRUE) list available models. model loaded (see examples ), call .list(mod)$code extract model code equations.","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Internal model library — modlib","text":"","code":"if (FALSE) { # \\dontrun{ mod <- mread(\"pk1cmt\", modlib()) mod <- mread(\"pk2cmt\", modlib()) mod <- mread(\"pk3cmt\", modlib()) mod <- mread(\"pk1\", modlib()) mod <- mread(\"pk2\", modlib()) mod <- mread(\"popex\", modlib()) mod <- mread(\"irm1\", modlib()) mod <- mread(\"irm2\", modlib()) mod <- mread(\"irm3\", modlib()) mod <- mread(\"irm4\", modlib()) mod <- mread(\"emax\", modlib()) mod <- mread(\"effect\", modlib()) mod <- mread(\"tmdd\", modlib()) mod <- mread(\"viral1\", modlib()) mod <- mread(\"viral2\", modlib()) mod <- mread(\"pred1\", modlib()) mod <- mread(\"pbpk\", modlib()) mod <- mread(\"1005\", modlib()) # embedded NONMEM result mod <- mread(\"nm-like\", modlib()) # model with nonmem-like syntax mod <- mread(\"evtools\", modlib()) as.list(mod)$code } # }"},{"path":"https://mrgsolve.org/docs/reference/modlib_details.html","id":null,"dir":"Reference","previous_headings":"","what":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","title":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","text":"modlib: PK/PD Model parameters, compartments, output variables","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_details.html","id":"compartments","dir":"Reference","previous_headings":"","what":"Compartments","title":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","text":"EV1, EV2: extravascular dosing compartments CENT: central PK compartment PERIPH: peripheral PK compartment PERIPH2: peripheral PK compartment 2 RESP: response PD compartment (irm models)","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_details.html","id":"output-variables","dir":"Reference","previous_headings":"","what":"Output variables","title":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","text":"CP: concentration central compartment (CENT/VC) RESP: response (emax model)","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_details.html","id":"pk-parameters","dir":"Reference","previous_headings":"","what":"PK parameters","title":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","text":"KA1, KA2: first order absorption rate constants first second extravascular compartment (1/time) CL: clearance (volume/time) VC: volume distribution, central compartment (volume) VP: volume distribution, peripheral compartment (volume) VP2: volume distribution, peripheral compartment 2 (volume) Q: intercompartmental clearance (volume/time) Q2: intercompartmental clearance 2 (volume/time) VMAX: maximum rate, nonlinear process (mass/time) KM: Michaelis constant (mass/volume) K10: elimination rate constant (1/time); CL/VC K12: rate constant transfer peripheral compartment central (1/time); Q/VC K21: rate constant transfer central compartment peripheral (1/time); Q/VP","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_details.html","id":"pd-parameters","dir":"Reference","previous_headings":"","what":"PD parameters","title":"modlib: PK/PD Model parameters, compartments, and output variables — modlib_details","text":"E0: baseline effect (emax model) EMAX, IMAX: maximum effect (response) EC50, IC50: concentration producing 50 percent effect (mass/volume) KIN: zero-order response production rate (irm models) (response/time) KOUT: first-order response elimination rate (irm models) (1/time) n: sigmoidicity factor KEO: rate constant transfer effect compartment (1/time)","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pk.html","id":null,"dir":"Reference","previous_headings":"","what":"modlib: Pharmacokinetic models — modlib_pk","title":"modlib: Pharmacokinetic models — modlib_pk","text":"modlib: Pharmacokinetic models","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modlib: Pharmacokinetic models — modlib_pk","text":"... passed update","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"modlib: Pharmacokinetic models — modlib_pk","text":"object class packmod","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"modlib: Pharmacokinetic models — modlib_pk","text":"See modlib_details detailed descriptions parameters compartments. pk1cmt model parameterized terms CL, VC, KA1 KA2 uses compartments EV1, EV2, CENT. pk2cmt model adds PERIPH compartment parameters Q VP one-compartment model. Likewise, three-compartment model (pk3cmt) adds PERIPH2 parameters Q2 VP2 two-compartment models. pk models also parameters VMAX (defaulting zero, non-linear clearance) KM.","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pk.html","id":"model-description","dir":"Reference","previous_headings":"","what":"Model description","title":"modlib: Pharmacokinetic models — modlib_pk","text":"pk models two extravascular dosing compartments potential linear nonlinear clearance. pk1cmt: one compartment pk model using ODEs pk2cmt: two compartment pk model using ODEs pk3cmt: three compartment pk model using ODEs pk1: one compartment pk model closed-form pk2: two compartment pk model closed-form popex: simple population pk model","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pkpd.html","id":null,"dir":"Reference","previous_headings":"","what":"modlib: Pharmacokinetic / pharmacodynamic models — modlib_pkpd","title":"modlib: Pharmacokinetic / pharmacodynamic models — modlib_pkpd","text":"modlib: Pharmacokinetic / pharmacodynamic models","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pkpd.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"modlib: Pharmacokinetic / pharmacodynamic models — modlib_pkpd","text":"See modlib_details detailed descriptions parameters compartments. PK/PD models include 2-compartment PK model absorption 2 extravascular compartments linear + nonlinear clearance. PK models parameterized CL, VC, Q, VMAX, KM, KA1 KA2 implement compartments EV1, EV2, CENT, PERIPH . indirect response models compartment RESP emax model output variable RESP. PD parameters include KIN, KOUT, IC50, EC50, IMAX, EMAX, E0, n. Also, model loaded, use see method mrgmod view model code.","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_pkpd.html","id":"model-description","dir":"Reference","previous_headings":"","what":"Model description","title":"modlib: Pharmacokinetic / pharmacodynamic models — modlib_pkpd","text":"irm1 inhibition response production irm2 inhibition response loss irm3 stimulation response production irm4 stimulation response loss pd_effect effect compartment model emax sigmoid emax model","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_tmdd.html","id":null,"dir":"Reference","previous_headings":"","what":"modlib: Target mediated disposition model — modlib_tmdd","title":"modlib: Target mediated disposition model — modlib_tmdd","text":"modlib: Target mediated disposition model","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_tmdd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"modlib: Target mediated disposition model — modlib_tmdd","text":"... passed update","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_tmdd.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"modlib: Target mediated disposition model — modlib_tmdd","text":"KEL: elimination rate constant KTP: tissue plasma rate constant KPT: plasma tissue rate constant VC: volume distribution KA1, KA2: absorption rate constants KINT: internalization rate constant KON: association rate constant KOFF: dissociation rate constant KSYN: target synthesis rate KDEG: target degredation rate constant","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_tmdd.html","id":"compartments","dir":"Reference","previous_headings":"","what":"Compartments","title":"modlib: Target mediated disposition model — modlib_tmdd","text":"CENT: unbound drug central compartment TISS: unbound drug tissue compartment REC: concentration target RC: concentration drug-target complex EV1, EV2: extravascular dosing compartments","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_tmdd.html","id":"output-variables","dir":"Reference","previous_headings":"","what":"Output variables","title":"modlib: Target mediated disposition model — modlib_tmdd","text":"CP: unbound drug central compartment TOTAL: total concentration target (complexed uncomplexed)","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_viral.html","id":null,"dir":"Reference","previous_headings":"","what":"modlib: HCV viral dynamics models — modlib_viral","title":"modlib: HCV viral dynamics models — modlib_viral","text":"modlib: HCV viral dynamics models","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_viral.html","id":"models","dir":"Reference","previous_headings":"","what":"Models","title":"modlib: HCV viral dynamics models — modlib_viral","text":"viral1: viral dynamics model single HCV species viral2: viral dynamics model wild-type mutant HCV species","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_viral.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"modlib: HCV viral dynamics models — modlib_viral","text":"s: new hepatocyte synthesis rate (cells/ml/day) d: hepatocyte death rate constant (1/day) p: viral production rate constant (copies/cell/day) beta: new infection rate constant (ml/copy/day) delta: infected cell death rate constant (1/day) c: viral clearance rate constant (1/day) fit: mutant virus fitness N: non-target hepatocytes mu: forward mutation rate Tmax: maximum number target hepatocytes (cells/ml) rho: maximum hepatocyte regeneration rate (1/day)","code":""},{"path":"https://mrgsolve.org/docs/reference/modlib_viral.html","id":"compartments","dir":"Reference","previous_headings":"","what":"Compartments","title":"modlib: HCV viral dynamics models — modlib_viral","text":"T: uninfected target hepatocytes (cells/ml) : productively infected hepatocytes (cells/ml) V: hepatitis C virus (copies/ml) IM: mutant infected hepatocytes (cells/ml) VM: mutant hepatitis C virus (copies/ml) expos: exposure metric drive pharmacodynamic model","code":""},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a model specification file — mread","title":"Read a model specification file — mread","text":"mread() reads parses mrgsolve model specification file, builds model, returns model object simulation. mread_cache() , caches compilation result later use. mread_file() can used convenience, taking model file name first argument.","code":""},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a model specification file — mread","text":"","code":"mread( model, project = getOption(\"mrgsolve.project\", getwd()), code = NULL, file = NULL, udll = TRUE, ignore.stdout = TRUE, raw = FALSE, compile = TRUE, audit = TRUE, quiet = getOption(\"mrgsolve_mread_quiet\", FALSE), check.bounds = FALSE, warn = TRUE, soloc = getOption(\"mrgsolve.soloc\", tempdir()), capture = NULL, preclean = FALSE, recover = FALSE, ... ) mread_cache( model = NULL, project = getOption(\"mrgsolve.project\", getwd()), file = paste0(model, \".cpp\"), code = NULL, soloc = getOption(\"mrgsolve.soloc\", tempdir()), quiet = FALSE, preclean = FALSE, capture = NULL, ... ) mread_file(file, ...)"},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a model specification file — mread","text":"model model name. project location model specification file headers included; see also discussion model; argument can set via options(). library details well modlib() help topic. code character string model specification code used instead model file. file full file name (extension, without path) model specified. udll use unique name shared object. ignore.stdout passed system call compiling model; set FALSE print output R console. raw TRUE, return model content list, bypassing compile step; argument typically used debugging problems model build. compile logical; TRUE, model built. audit check model specification file errors. quiet print messages mrgsolve compiling. check.bounds check boundaries parameter list. warn logical; TRUE, print warning messages may arise building model. soloc directory location model shared object built stored; see details; argument can set via options(); directory exist, mread() attempt create . capture character vector comma-separated string additional model variables capture; variables added capture list current call mread() . preclean logical; TRUE, compilation artifacts cleaned first. recover TRUE, list build returned case model shared object fails compile; use option returned object collect information assist debugging. ... passed update(); also arguments passed mread() mread_cache().","code":""},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a model specification file — mread","text":"model argument required. typical use, file argument omitted value file generated value model. determine source file name, mrgsolve look file extension model. file extension assumed finds period followed one three alpha-numeric characters end string (e.g. mymodel.txt .model). file extension found, extension .cpp assumed (e.g. file <model-name>.cpp). file extension found, file <model-name>. Best practice avoid using . model unless using model point model specification file name. Otherwise, use mread_file(). Use soloc argument specify directory location building model. location model shared object stored disk. default temporary directory, compilation artifacts lost R restarts default used. Changing soloc persistent directory location preserve artifacts across R restarts. Also, simulation single model done separate processes separate compute nodes, might necessary store compilation artifacts local directory make accessible different nodes. soloc directory exist, mread() attempt create . Similarly, using mread_cache() cache results temporary directory cache accessed R process restarted.","code":""},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":"model-library","dir":"Reference","previous_headings":"","what":"Model Library","title":"Read a model specification file — mread","text":"mrgsolve comes bundled several pre-coded PK, PK/PD, systems models accessible via mread() interface. Models available library include: PK models: pk1cmt, pk2cmt, pk3cmt, pk1, pk2, popex, tmdd PKPD models: irm1, irm2, irm3, irm4, emax, effect models: viral1, viral2 library model accessed, mrgsolve compile load model model. necessary reference correct model name point project argument mrgsolve model library location via modlib(). details, see modlib_pk, modlib_pkpd, modlib_tmdd, modlib_viral, modlib_details information state variables parameters model.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mread.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a model specification file — mread","text":"","code":"if (FALSE) { # \\dontrun{ code <- ' $PARAM CL = 1, VC = 5 $CMT CENT $ODE dxdt_CENT = -(CL/VC)*CENT; ' mod <- mcode(\"ex_mread\", code) mod mod %>% init(CENT=1000) %>% mrgsim() %>% plot() mod <- mread(\"irm3\", modlib()) # if the model is in the file mymodel.cpp mod <- mread(\"mymodel\") # if the model is in the file mymodel.txt mod <- mread(file = \"mymodel.txt\") or mod <- mread_file(\"mymodel.txt\") } # }"},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a model from yaml format — mread_yaml","title":"Read a model from yaml format — mread_yaml","text":"Read back models written file using mwrite_yaml(). Function yaml_to_cpp() also provided convert yaml file mrgsolve cpp file format.","code":""},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a model from yaml format — mread_yaml","text":"","code":"mread_yaml( file, model = basename(file), project = tempdir(), update = FALSE, ... ) yaml_to_cpp(file, model = basename(file), project = getwd(), update = TRUE)"},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a model from yaml format — mread_yaml","text":"file yaml file name. model new model name use calling mread_yaml(). project directory model built. update TRUE model settings written cpp file $SET block. ... passed mread().","code":""},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a model from yaml format — mread_yaml","text":"model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a model from yaml format — mread_yaml","text":"Note yaml_to_cpp() default writes model settings cpp file. mread_yaml() write model settings file rather update model object directly data read back yaml file.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mread_yaml.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a model from yaml format — mread_yaml","text":"","code":"mod <- house() temp <- tempfile(fileext = \".yaml\") mwrite_yaml(mod, file = temp) # Note: this model is not compiled mod <- mread_yaml(temp, model = \"new-house\", compile = FALSE) mod #> #> #> -------------- source: new-house.mod -------------- #> #> project: /private/var/fol.../T/RtmpRwrIeP #> shared object: new-house.mod-so-1661c6a7016bc <not loaded> #> #> time: start: 0 end: 120 delta: 0.25 #> add: <none> #> compartments: GUT CENT RESP [3] #> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC #> KIN KOUT IC50 WT SEX [14] #> captures: DV CP [2] #> omega: 4x4 #> sigma: 1x1 #> #> solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar) #> ------------------------------------------------------ cppfile <- yaml_to_cpp(temp, project = tempdir()) readLines(cppfile) #> [1] \"$PROB\" #> [2] \"# `mrgsolve` housemodel\" #> [3] \"This model is compiled with `mrgsolve`.\" #> [4] \" - Author: Metrum Research Group, LLC\" #> [5] \" - Description: Generic indirect response PK/PD model\" #> [6] \" - Covariates: Weight, female sex\" #> [7] \" - Random effects: CL, VC, KA, KOUT\" #> [8] \" - Error model: exponential\" #> [9] \"\" #> [10] \"# Model Annotations: \" #> [11] \"\" #> [12] \"block name descr unit \" #> [13] \"-------- ------ ------------------------- ---------\" #> [14] \"PARAM CL Clearance L/hr \" #> [15] \"PARAM VC Volume of distribution L \" #> [16] \"PARAM KA Absorption rate constant 1/hr \" #> [17] \"PARAM F1 Bioavailability fraction . \" #> [18] \"PARAM D1 Infusion duration hr \" #> [19] \"PARAM WTCL Exponent WT on CL . \" #> [20] \"PARAM WTVC Exponent WT on VC . \" #> [21] \"PARAM SEXCL Prop cov effect on CL . \" #> [22] \"PARAM SEXVC Prop cov effect on VC . \" #> [23] \"PARAM KIN Resp prod rate constant 1/hr \" #> [24] \"PARAM KOUT Resp elim rate constant 1/hr \" #> [25] \"PARAM IC50 Conc giving 50% max resp ng/ml \" #> [26] \"PARAM WT Weight kg \" #> [27] \"PARAM SEX Covariate female sex . \" #> [28] \"CMT GUT Dosing compartment mg \" #> [29] \"CMT CENT Central compartment mg \" #> [30] \"CMT RESP Response unitless \" #> [31] \"CAPTURE DV Dependent variable ng/ml \" #> [32] \"CAPTURE CP Plasma concentration ng/ml \" #> [33] \"\" #> [34] \"$PARAM\" #> [35] \"CL = 1\" #> [36] \"VC = 20\" #> [37] \"KA = 1.2\" #> [38] \"F1 = 1\" #> [39] \"D1 = 2\" #> [40] \"WTCL = 0.75\" #> [41] \"WTVC = 1\" #> [42] \"SEXCL = 0.7\" #> [43] \"SEXVC = 0.85\" #> [44] \"KIN = 100\" #> [45] \"KOUT = 2\" #> [46] \"IC50 = 10\" #> [47] \"WT = 70\" #> [48] \"SEX = 0\" #> [49] \"\" #> [50] \"$INIT\" #> [51] \"GUT = 0\" #> [52] \"CENT = 0\" #> [53] \"RESP = 50\" #> [54] \"\" #> [55] \"$OMEGA\" #> [56] \"@block\" #> [57] \"@labels ECL EVC EKA EKOUT\" #> [58] \"// row 1\" #> [59] \"0\" #> [60] \"// row 2\" #> [61] \"0\" #> [62] \"0\" #> [63] \"// row 3\" #> [64] \"0\" #> [65] \"0\" #> [66] \"0\" #> [67] \"// row 4\" #> [68] \"0\" #> [69] \"0\" #> [70] \"0\" #> [71] \"0\" #> [72] \"\" #> [73] \"$SIGMA\" #> [74] \"@block\" #> [75] \"@labels EXPO\" #> [76] \"// row 1\" #> [77] \"0\" #> [78] \"\" #> [79] \"$PLUGIN\" #> [80] \"base\" #> [81] \" \" #> [82] \"$GLOBAL\" #> [83] \"#define CP (CENT/VCi)\" #> [84] \"#define INH (CP/(IC50+CP))\" #> [85] \"typedef double localdouble;\" #> [86] \" \" #> [87] \"$MAIN\" #> [88] \"F_GUT = F1;\" #> [89] \"D_CENT = D1;\" #> [90] \"double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL);\" #> [91] \"double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC);\" #> [92] \"double KAi = exp(log(KA) + EKA);\" #> [93] \"double KOUTi = exp(log(KOUT) + EKOUT);\" #> [94] \"RESP_0 = KIN/KOUTi;\" #> [95] \" \" #> [96] \"$ODE\" #> [97] \"dxdt_GUT = -KAi*GUT;\" #> [98] \"dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT;\" #> [99] \"dxdt_RESP = KIN*(1-INH) - KOUTi*RESP;\" #> [100] \" \" #> [101] \"$TABLE\" #> [102] \"double DV = CP*exp(EXPO);\" #> [103] \" \" #> [104] \"$CAPTURE\" #> [105] \"DV\" #> [106] \"CP\" #> [107] \"\" #> [108] \"$SET\" #> [109] \"end = 120\" #> [110] \"delta = 0.25\" #> [111] \" \" #> [112] \"start = 0\" #> [113] \"end = 120\" #> [114] \"delta = 0.25\" #> [115] \"add = numeric(0)\" #> [116] \"atol = 1e-08\" #> [117] \"rtol = 1e-08\" #> [118] \"ss_atol = 1e-08\" #> [119] \"ss_rtol = 1e-08\" #> [120] \"maxsteps = 20000\" #> [121] \"hmax = 0\" #> [122] \"hmin = 0\" #> [123] \"mxhnil = 2\" #> [124] \"ixpr = 0\" #> [125] \"mindt = 2.22044605e-15\" #> [126] \"digits = -1\" #> [127] \"tscale = 1\" #> [128] \"outvars = c(\\\"GUT\\\", \\\"CENT\\\", \\\"RESP\\\", \\\"DV\\\", \\\"CP\\\")\" #> [129] \"\""},{"path":"https://mrgsolve.org/docs/reference/mrgmod-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for mrgsolve model object — mrgmod-class","title":"S4 class for mrgsolve model object — mrgmod-class","text":"S4 class mrgsolve model object","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgmod-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for mrgsolve model object — mrgmod-class","text":"model model name <character> modfile source model specification file name <character> package shared object file name character> project working directory; must writeable spaces <character> start simulation start time <numeric> end simulation end time <numeric> delta simulation time interval <numeric> add additional simulation times <numeric-vector> param <parameter_list> fixed <parameter_list> fixed value parameters; updatable R init <cmt_list> digits significant digits simulated output; negative integer means ignore <numeric> hmin passed dlsoda <numeric> hmax passed dlsoda <numeric> mxhnil passed dlsoda <numeric> ixpr passed dlsoda <numeric> itol passed dlsoda <int>; itol=1 indicates scalar values atol rtol; itol=4 indicates customized tolerances compartment atol passed dlsoda <numeric> rtol passed dlsoda <numeric> vec_rtol vector rtol used itol=4 <numeric> vec_atol vector atol used itol=4 <numeric> ss_rtol relative tolerance use finding PK steady state <numeric> ss_atol absolute tolerance use finding PK steady state <numeric> maxsteps passed dlsoda <numeric> preclean passed R CMD SHLIB compilation <logical> verbose print run information screen <logical> quiet print various information screen <logical> debug used tscale used scale time simulated output <numeric> omega matlist simulating individual-level random effects sigma matlist simulating residual error variates args <list> arguments passed mrgsim advan either 2, 4, 13 <numeric> trans either 1, 2, 4, 11 <numeric> request vector compartments request <character> soloc directory path storing model shared object <character> code character vector model code capture character vector variables captured simulation <character> mindt minimum time simulation records <numeric> envir internal model environment <environment> shlib list data related build outcome <list> funs symbol names model functions shared object annot model annotations <list> plugin model plugins <character> Icap capture indices recover simulation <integer> capL labels Icap; <character> Icmt compartment indices recover simulation <integer> cmtL labels Icmt; <character> ss_cmt compartments numbers considered advancing system steady state <integer>","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgmod-class.html","id":"notes","dir":"Reference","previous_headings":"","what":"Notes","title":"S4 class for mrgsolve model object — mrgmod-class","text":"Spaces paths (project soloc) prohibited.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgmod_extract.html","id":null,"dir":"Reference","previous_headings":"","what":"Select parameter values from a model object — $,mrgmod-method","title":"Select parameter values from a model object — $,mrgmod-method","text":"$ [[ operators get value single parameter model. [ gets several values, returning named list.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgmod_extract.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select parameter values from a model object — $,mrgmod-method","text":"","code":"# S4 method for class 'mrgmod' x$name # S4 method for class 'mrgmod' x[[i, exact = TRUE]] # S4 method for class 'mrgmod' x[i]"},{"path":"https://mrgsolve.org/docs/reference/mrgmod_extract.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select parameter values from a model object — $,mrgmod-method","text":"x mrgmod object name parameter take element select exact used","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate from a model object — mrgsim","title":"Simulate from a model object — mrgsim","text":"function sets simulation run data stored model object well arguments passed . Use mrgsim_q() instead benchmark mrgsolve repeated quick simulation tasks like parameter optimization, sensitivity analyses, optimal design. See mrgsim_variants mrgsim-like functions focused inputs. mrgsim_df coerces output data.frame prior returning.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate from a model object — mrgsim","text":"","code":"mrgsim(x, data = NULL, idata = NULL, events = NULL, nid = NULL, ...) mrgsim_df(..., output = \"df\") do_mrgsim( x, data, idata = no_idata_set(), carry_out = carry.out, carry.out = character(0), recover = character(0), seed = as.integer(NA), Request = character(0), output = NULL, capture = NULL, obsonly = FALSE, obsaug = FALSE, tgrid = NULL, etasrc = \"omega\", recsort = 1, deslist = list(), descol = character(0), filbak = TRUE, tad = FALSE, nocb = TRUE, skip_init_calc = FALSE, ss_n = 500, ss_fixed = FALSE, interrupt = 256, ... )"},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate from a model object — mrgsim","text":"x model object. data NMTRAN-like data set (see data_set()). idata matrix data frame model parameters, one parameter per row (see idata_set()). events event object. nid integer number individuals simulate; used idata data missing. ... passed update() do_mrgsim(). output NULL (default) mrgsims object returned; otherwise, pass df return data.frame matrix return matrix. carry_out numeric data items copy output. carry.soon deprecated; use carry_out instead. recover character column names either data idata join back (recover) simulated data; may class (e.g. numeric, character, factor, etc). seed deprecated. Request compartments captured variables retain simulated output; different request slot model object, refers model compartments. capture character file name used debugging (related $CAPTURE). obsonly TRUE, dosing records included output. obsaug augment data set time grid observations; TRUE full data set used, simulated output augmented observation time stime(). using obsaug, flag indicating augmented observations can requested including .u.g carry_out. tgrid tgrid object; numeric vector simulation times another object stime method. etasrc source ETA() values model; values can include: \"omega\", \"data\", \"data.\", \"idata\", \"idata.\"; see 'Details'. recsort record sorting flag. Default value 1. Possible values 1,2,3,4: 1 2 put doses data set padded observations time; 3 4 put doses padded observations time. 2 4 put doses scheduled addl observations time; 1 3 put doses scheduled addl observations time. recsort change order input data set doses observations given. deslist list tgrid objects. descol name column assigning designs. filbak carry data items backward first data set row time greater zero. tad TRUE column added simulated output added showing time since last dose. data records evid == 1 considered doses purposes tad calculation. tad can properly calculated dosing lag time model long dosing lag time (specified $MAIN) always appropriate subsequent doses scheduled addl. always true lag time change time. might (possibly) hold lag time changes prior last dose addl sequence. known limitation affect tad calculation common dosing lag time implementations. nocb TRUE, use next observation carry backward method; otherwise, use locf. skip_init_calc use $MAIN calculate initial conditions. ss_n maximum number iterations determining steady state PK system; warning issued steady state achieved within ss_n iterations ss_fixed TRUE. ss_fixed FALSE (default), warning issued system reach steady state within ss_n iterations given model tolerances rtol atol; TRUE, number iterations determining steady state capped ss_n warning issued steady state reached within ss_n dosing iterations. silence warnings related steady state, set ss_fixed TRUE set ss_n maximum number iterations try advancing system steady state determination. interrupt integer check user interrupt interval; interrupt positive integer, simulation check user interrupt signal every interrupt simulation records; pass negative number never check user interrupt interval.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate from a model object — mrgsim","text":"object class mrgsims.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulate from a model object — mrgsim","text":"Use mrgsim_df() return data frame rather mrgsims object. data idata coerced numeric matrix carry_out can used insert data columns output data set. partially dependent nature data brought problem. using data idata together, error generated ID occurs data idata. Also, looking data idata, ID idata assumed uniquely keyed ID data. error generated ID duplicated data; parameters used first occurrence found idata. carry_out: idata assumed individual-level variables carried idata repeated throughout individual's simulated data. Variables carried data carried via last-observation carry forward. NA returned observations inserted simulated output occur prior first record data. recover: similar carry_out respect end result, uses different process. Columns recovered cached prior running simulation, joined back simulated data. , whereas carry_out accept numeric data items, recover can handle data frame columns type. small decrease performance recover compared carry_out, likely performance difference difficult perceive (simulation runs fast) small fractional increase run time simulation large. performance hit likely well worth light convenience gain. Just think carefully using feature every millisecond counts. etasrc: argument lets control ETA(n) come model. etasrc set \"omega\" (default), ETAs simulated multivariate normal distribution defined $OMEGA blocks model. Alternatively, input data idata sets can used pass fixed ETA(n) setting etasrc \"data\", \"idata\", \"data.\" \"idata.\". etasrc set \"data\" \"data.\", input data set scanned columns called ETA1, ETA2, ..., ETAn values copied appropriate slot ETA() vector. first record individual copied ETA(); records first ignored. 9 ETAs model, NONMEM start naming outputs ET10, ET11 etc rather ETA10 ETA11. mrgsolve looking columns, first search, example, ET10 use value found. ET10 found 9 ETAs, also search ETA10. error generated case mrgsolve finds ETA ET name variant tenth higher ETA (e.g. error ETA10 ET10 data set). mrgsolve searching ETA columns data set, look ETAn number rows (columns) model $OMEGA blocks. example, $OMEGA 5x5, ETA1 ETA5 searched. error generated case mrgsolve finds columns ETAn names something etasrc = \"omega\" passed. etasrc = \"data\" ETAn column missing data set, missing ETA() set 0. Alternatively, user can pass etasrc = \"data.\" causes error generated ETAn missing data set. Use option intend ETAs attached data set want error generated mrgsolve finds one missing. Using etasrc =\"idata\" \"idata.\", behavior identical \"data\" (\"data.\"), except mrgsolve look idata set rather data set.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate from a model object — mrgsim","text":"","code":"## example(\"mrgsim\") e <- ev(amt = 1000) mod <- mrgsolve::house() out <- mod %>% ev(e) %>% mrgsim() plot(out) out <- mod %>% ev(e) %>% mrgsim(end=22) out #> Model: housemodel #> Dim: 90 x 7 #> Time: 0 to 22 #> ID: 1 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.0 0.0 50.00 0.00 0.00 #> 2: 1 0.00 1000.0 0.0 50.00 0.00 0.00 #> 3: 1 0.25 740.8 257.5 42.29 12.87 12.87 #> 4: 1 0.50 548.8 445.0 32.69 22.25 22.25 #> 5: 1 0.75 406.6 580.8 25.29 29.04 29.04 #> 6: 1 1.00 301.2 678.3 20.05 33.91 33.91 #> 7: 1 1.25 223.1 747.4 16.45 37.37 37.37 #> 8: 1 1.50 165.3 795.6 14.01 39.78 39.78 data(exTheoph) out <- mod %>% data_set(exTheoph) %>% mrgsim() out #> Model: housemodel #> Dim: 132 x 7 #> Time: 0 to 24.65 #> ID: 12 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 4.020000 0.000 50.00 0.00000 0.00000 #> 2: 1 0.25 2.978089 1.035 49.95 0.04552 0.04552 #> 3: 1 0.57 2.028470 1.961 49.81 0.08624 0.08624 #> 4: 1 1.12 1.048417 2.875 49.57 0.12643 0.12643 #> 5: 1 2.02 0.356038 3.428 49.33 0.15072 0.15072 #> 6: 1 3.82 0.041060 3.439 49.25 0.15121 0.15121 #> 7: 1 5.10 0.008838 3.263 49.28 0.14348 0.14348 #> 8: 1 7.03 0.000872 2.980 49.34 0.13101 0.13101 out <- mod %>% mrgsim(data=exTheoph) out <- mrgsim(mod, data=exTheoph, obsonly=TRUE) out #> Model: housemodel #> Dim: 120 x 7 #> Time: 0.25 to 24.65 #> ID: 12 #> ID time GUT CENT RESP DV CP #> 1: 1 0.25 2.978e+00 1.035 49.95 0.04552 0.04552 #> 2: 1 0.57 2.028e+00 1.961 49.81 0.08624 0.08624 #> 3: 1 1.12 1.048e+00 2.875 49.57 0.12643 0.12643 #> 4: 1 2.02 3.560e-01 3.428 49.33 0.15072 0.15072 #> 5: 1 3.82 4.106e-02 3.439 49.25 0.15121 0.15121 #> 6: 1 5.10 8.838e-03 3.263 49.28 0.14348 0.14348 #> 7: 1 7.03 8.720e-04 2.980 49.34 0.13101 0.13101 #> 8: 1 9.05 7.723e-05 2.703 49.40 0.11884 0.11884 out <- mod %>% mrgsim(data=exTheoph, obsaug=TRUE, carry_out=\"a.u.g\") out #> Model: housemodel #> Dim: 5904 x 8 #> Time: 0 to 120 #> ID: 12 #> ID time a.u.g GUT CENT RESP DV CP #> 1: 1 0.00 1 0.000 0.000 50.00 0.00000 0.00000 #> 2: 1 0.00 0 4.020 0.000 50.00 0.00000 0.00000 #> 3: 1 0.25 1 2.978 1.035 49.95 0.04552 0.04552 #> 4: 1 0.25 0 2.978 1.035 49.95 0.04552 0.04552 #> 5: 1 0.50 1 2.206 1.790 49.84 0.07870 0.07870 #> 6: 1 0.57 0 2.028 1.961 49.81 0.08624 0.08624 #> 7: 1 0.75 1 1.634 2.337 49.73 0.10274 0.10274 #> 8: 1 1.00 1 1.211 2.729 49.61 0.12001 0.12001 out <- mod %>% ev(e) %>% mrgsim(outvars=\"CP,RESP\") out #> Model: housemodel #> Dim: 482 x 4 #> Time: 0 to 120 #> ID: 1 #> ID time RESP CP #> 1: 1 0.00 50.00 0.00 #> 2: 1 0.00 50.00 0.00 #> 3: 1 0.25 42.29 12.87 #> 4: 1 0.50 32.69 22.25 #> 5: 1 0.75 25.29 29.04 #> 6: 1 1.00 20.05 33.91 #> 7: 1 1.25 16.45 37.37 #> 8: 1 1.50 14.01 39.78 a <- ev(amt = 1000, group = 'a') b <- ev(amt = 750, group = 'b') data <- as_data_set(a,b) out <- mrgsim_d(mod, data, recover=\"group\") out #> Model: housemodel #> Dim: 964 x 8 #> Time: 0 to 120 #> ID: 2 #> ID time GUT CENT RESP DV CP group #> 1: 1 0.00 0.0 0.0 50.00 0.00 0.00 a #> 2: 1 0.00 1000.0 0.0 50.00 0.00 0.00 a #> 3: 1 0.25 740.8 257.5 42.29 12.87 12.87 a #> 4: 1 0.50 548.8 445.0 32.69 22.25 22.25 a #> 5: 1 0.75 406.6 580.8 25.29 29.04 29.04 a #> 6: 1 1.00 301.2 678.3 20.05 33.91 33.91 a #> 7: 1 1.25 223.1 747.4 16.45 37.37 37.37 a #> 8: 1 1.50 165.3 795.6 14.01 39.78 39.78 a"},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate from a model object with quicker turnaround — mrgsim_q","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"Use function usually use mrgsim_d(), need quicker turnaround time. timing differences might difficult detect single simulation run become appreciable repeated simulation. See Details important differences mrgsim_q() invoked compared mrgsim() mrgsim_d(). function always used benchmarking simulation time mrgsolve.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"","code":"mrgsim_q( x, data, recsort = 1, stime = numeric(0), output = \"mrgsims\", skip_init_calc = FALSE, simcall = 0, etasrc = \"omega\" )"},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"x model object. data simulation data set. recsort record sorting flag. stime numeric vector observation times; observation times added output observation records data. output output data type; \"mrgsims\", default output object returned; \"df\"` data frame returned. skip_init_calc use $MAIN calculate initial conditions. simcall used; default value 0 allowed. etasrc source ETA() values model; values can include: \"omega\", \"data\", \"data.\", \"idata\", \"idata.\"; see 'Details' mrgsim().","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"default, object class mrgsims. Use output = \"df\" return data frame.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"mrgsim_q() mainly cuts overhead simulation. , primary efficiency gain using mrgsim_q() comes simulation executes quickly. unlikely see big performance difference mrgsim_q() mrgsim() model difficult solve large input data set. function support piped simulation workflow. arguments must passed function except x. data set required simulation workflow. data set can dosing records doses observations. data set includes doses, single numeric vector observation times passed . simulation workflow support Req (request) functionality. compartments captured variables always returned simulation output. simulation workflow support carry-functionality. simulation workflow accept arguments passed update(). must done separate call update(). simulation workflow support use event objects. event object needed, converted data set prior simulation run (see as_data_set() .data.frame()). simulation workflow support idata sets feature enabled idata set use. Individual level parameters joined onto data set prior simulation. Otherwise mrgsim_i() mrgsim_ei() used. default, mrgsims object returned (mrgsim()). Use output = \"df\" argument request plain data.frame simulated data return.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsim_q.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate from a model object with quicker turnaround — mrgsim_q","text":"","code":"mod <- mrgsolve::house() data <- expand.ev(amt = c(100, 300, 1000)) out <- mrgsim_q(mod, data) out #> Model: housemodel #> Dim: 1446 x 7 #> Time: 0 to 120 #> ID: 3 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00 0.00 0.00 50.00 0.000 0.000 #> 2: 1 0.00 100.00 0.00 50.00 0.000 0.000 #> 3: 1 0.25 74.08 25.75 48.68 1.287 1.287 #> 4: 1 0.50 54.88 44.50 46.18 2.225 2.225 #> 5: 1 0.75 40.66 58.08 43.61 2.904 2.904 #> 6: 1 1.00 30.12 67.83 41.38 3.391 3.391 #> 7: 1 1.25 22.31 74.74 39.58 3.737 3.737 #> 8: 1 1.50 16.53 79.56 38.18 3.978 3.978"},{"path":"https://mrgsolve.org/docs/reference/mrgsim_variants.html","id":null,"dir":"Reference","previous_headings":"","what":"mrgsim variant functions — mrgsim_variants","title":"mrgsim variant functions — mrgsim_variants","text":"functions called mrgsim() explicit input requirements written function name. motivation behind variants give user clear workflow specific, required inputs indicated function name. Use mrgsim_q() instead benchmark mrgsolve repeated quick simulation tasks like parameter optimization, sensitivity analyses, optimal design.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim_variants.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"mrgsim variant functions — mrgsim_variants","text":"","code":"mrgsim_e(x, events, idata = NULL, data = NULL, ...) mrgsim_d(x, data, idata = NULL, events = NULL, ...) mrgsim_ei(x, events, idata, data = NULL, ...) mrgsim_di(x, data, idata, events = NULL, ...) mrgsim_i(x, idata, data = NULL, events = NULL, ...) mrgsim_0(x, idata = NULL, data = NULL, events = NULL, ...)"},{"path":"https://mrgsolve.org/docs/reference/mrgsim_variants.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"mrgsim variant functions — mrgsim_variants","text":"x model object. events event object. idata matrix data frame model parameters, one parameter per row (see idata_set()). data NMTRAN-like data set (see data_set()). ... passed update() do_mrgsim().","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsim_variants.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"mrgsim variant functions — mrgsim_variants","text":"Important: functions require data, idata, /events pass directly functions. recognize inputs pipeline. mrgsim_e simulate using event object mrgsim_ei simulate using event object idata_set mrgsim_d simulate using data_set mrgsim_di simulate using data_set idata_set mrgsim_i simulate using idata_set mrgsim_0 simulate using just model mrgsim_q simulate data set quicker turnaround (see mrgsim_q())","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsims-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class for mrgsolve simulation output — mrgsims-class","title":"S4 class for mrgsolve simulation output — mrgsims-class","text":"S4 class mrgsolve simulation output","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"S4 class for mrgsolve simulation output — mrgsims-class","text":"request character vector compartments requested simulated output outnames character vector column names simulated output coming table step data data.frame simulated data mod mrgmod model object","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims.html","id":null,"dir":"Reference","previous_headings":"","what":"Methods for working with mrgsims objects — mrgsims","title":"Methods for working with mrgsims objects — mrgsims","text":"methods help user view simulation output extract simulated data work . methods listed part generics defined R R packages. See See Also section methods defined mrgsolve documentation pages.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Methods for working with mrgsims objects — mrgsims","text":"","code":"# S4 method for class 'mrgsims' x$name # S4 method for class 'mrgsims' tail(x, ...) # S4 method for class 'mrgsims' head(x, ...) # S4 method for class 'mrgsims' dim(x) # S4 method for class 'mrgsims' names(x) # S4 method for class 'mrgsims' as.data.frame(x, row.names = NULL, optional = FALSE, ...) # S4 method for class 'mrgsims' as.matrix(x, ...) # S3 method for class 'mrgsims' summary(object, ...) # S4 method for class 'mrgsims' show(object)"},{"path":"https://mrgsolve.org/docs/reference/mrgsims.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Methods for working with mrgsims objects — mrgsims","text":"x mrgsims object. name name column simulated output retain ... passed functions. row.names passed .data.frame(). optional passed .data.frame(). object passed show.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Methods for working with mrgsims objects — mrgsims","text":"methods behave expected according method commonly used R (e.g. head, tail, .data.frame, etc ...) $ selects column simulated data returns numeric head() see head.matrix(); returns simulated data tail() see tail.matrix(); returns simulated data dim(), nrow(), ncol() returns dimensions, number rows, number columns simulated data .data.frame() coerces simulated data data.frame .matrix() returns matrix simulated data summary() coerces simulated data data.frame passes summary.data.frame() plot() plots simulated data; see plot_mrgsims","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsims.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Methods for working with mrgsims objects — mrgsims","text":"","code":"## example(\"mrgsims\") mod <- mrgsolve::house() %>% init(GUT=100) out <- mrgsim(mod) class(out) #> [1] \"mrgsims\" #> attr(,\"package\") #> [1] \"mrgsolve\" if (FALSE) { # \\dontrun{ out } # } head(out) #> ID time GUT CENT RESP DV CP #> 1 1 0.00 100.00000 0.00000 50.00000 0.000000 0.000000 #> 2 1 0.25 74.08182 25.74883 48.68223 1.287441 1.287441 #> 3 1 0.50 54.88116 44.50417 46.18005 2.225208 2.225208 #> 4 1 0.75 40.65697 58.08258 43.61333 2.904129 2.904129 #> 5 1 1.00 30.11942 67.82976 41.37943 3.391488 3.391488 #> 6 1 1.25 22.31302 74.74256 39.57649 3.737128 3.737128 tail(out) #> ID time GUT CENT RESP DV CP #> 476 1 118.75 9.263629e-44 0.2753340 49.92950 0.01376670 0.01376670 #> 477 1 119.00 5.404491e-44 0.2719137 49.93038 0.01359569 0.01359569 #> 478 1 119.25 2.473491e-44 0.2685360 49.93124 0.01342680 0.01342680 #> 479 1 119.50 2.514809e-44 0.2652002 49.93209 0.01326001 0.01326001 #> 480 1 119.75 1.885697e-44 0.2619058 49.93293 0.01309529 0.01309529 #> 481 1 120.00 1.174272e-44 0.2586523 49.93377 0.01293262 0.01293262 dim(out) #> [1] 481 7 names(out) #> [1] \"ID\" \"time\" \"GUT\" \"CENT\" \"RESP\" \"DV\" \"CP\" mat <- as.matrix(out) df <- as.data.frame(out) if (FALSE) { # \\dontrun{ out$CP } # } plot(out) if (FALSE) { # \\dontrun{ plot(out, CP~.) plot(out, CP+RESP~time, scales=\"same\", xlab=\"Time\", main=\"Model sims\") } # }"},{"path":"https://mrgsolve.org/docs/reference/mrgsims_dplyr.html","id":null,"dir":"Reference","previous_headings":"","what":"Methods for handling output with dplyr verbs — mrgsims_dplyr","title":"Methods for handling output with dplyr verbs — mrgsims_dplyr","text":"methods modify data mrgsims object return data frame. Contrast functions mrgsims_modify.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims_dplyr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Methods for handling output with dplyr verbs — mrgsims_dplyr","text":"","code":"# S3 method for class 'mrgsims' pull(.data, ...) # S3 method for class 'mrgsims' filter(.data, ...) # S3 method for class 'mrgsims' group_by(.data, ..., add = FALSE, .add = FALSE) # S3 method for class 'mrgsims' distinct(.data, ..., .keep_all = FALSE) # S3 method for class 'mrgsims' mutate(.data, ...) # S3 method for class 'each' summarise(.data, funs, ...) # S3 method for class 'mrgsims' summarise(.data, ...) # S3 method for class 'mrgsims' do(.data, ..., .dots) # S3 method for class 'mrgsims' select(.data, ...) # S3 method for class 'mrgsims' slice(.data, ...) as_data_frame.mrgsims(x, ...) # S3 method for class 'mrgsims' as_tibble(x, ...) as.tbl.mrgsims(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/mrgsims_dplyr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Methods for handling output with dplyr verbs — mrgsims_dplyr","text":".data mrgsims object; passed various dplyr functions ... passed methods add passed dplyr::group_by (dplyr < 1.0.0) .add passed dplyr::group_by (dplyr >= 1.0.0) .keep_all passed dplyr::distinct funs passed dplyr::summarise_each .dots passed various dplyr functions x mrgsims object.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims_dplyr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Methods for handling output with dplyr verbs — mrgsims_dplyr","text":"select_sims function, dots ... must either compartment names variables $CAPTURE. error generated valid names selected names selection found simulated output.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsims_dplyr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Methods for handling output with dplyr verbs — mrgsims_dplyr","text":"","code":"out <- mrgsim(house(), events = ev(amt = 100), end = 5, delta=1) dplyr::filter(out, time==2) #> # A tibble: 1 × 7 #> ID time GUT CENT RESP DV CP #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 2 9.07 85.0 36.4 4.25 4.25 dplyr::mutate(out, label = \"abc\") #> # A tibble: 7 × 8 #> ID time GUT CENT RESP DV CP label #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 1 0 0 0 50 0 0 abc #> 2 1 0 100 0 50 0 0 abc #> 3 1 1 30.1 67.8 41.4 3.39 3.39 abc #> 4 1 2 9.07 85.0 36.4 4.25 4.25 abc #> 5 1 3 2.73 87.0 35.1 4.35 4.35 abc #> 6 1 4 0.823 84.6 35.0 4.23 4.23 abc #> 7 1 5 0.248 81.0 35.4 4.05 4.05 abc dplyr::select(out, time, RESP, CP) #> # A tibble: 7 × 3 #> time RESP CP #> <dbl> <dbl> <dbl> #> 1 0 50 0 #> 2 0 50 0 #> 3 1 41.4 3.39 #> 4 2 36.4 4.25 #> 5 3 35.1 4.35 #> 6 4 35.0 4.23 #> 7 5 35.4 4.05"},{"path":"https://mrgsolve.org/docs/reference/mrgsims_modify.html","id":null,"dir":"Reference","previous_headings":"","what":"Methods for modifying mrgsims objects — mrgsims_modify","title":"Methods for modifying mrgsims objects — mrgsims_modify","text":"functions modify simulated data mrgsims object return modified object. Contrast functions mrgsims_dplyr.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsims_modify.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Methods for modifying mrgsims objects — mrgsims_modify","text":"","code":"mutate_sims(.data, ...) select_sims(.data, ...) filter_sims(.data, ...)"},{"path":"https://mrgsolve.org/docs/reference/mrgsims_modify.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Methods for modifying mrgsims objects — mrgsims_modify","text":".data mrgsims object. ... arguments passed dplyr functions.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsims_modify.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Methods for modifying mrgsims objects — mrgsims_modify","text":"","code":"out <- mrgsim(house(), events = ev(amt = 100)) filter_sims(out, time > 2) #> Model: housemodel #> Dim: 472 x 7 #> Time: 2.25 to 120 #> ID: 1 #> ID time GUT CENT RESP DV CP #> 1: 1 2.25 6.721 86.23 35.84 4.312 4.312 #> 2: 1 2.50 4.979 86.89 35.46 4.345 4.345 #> 3: 1 2.75 3.688 87.09 35.22 4.355 4.355 #> 4: 1 3.00 2.732 86.96 35.07 4.348 4.348 #> 5: 1 3.25 2.024 86.59 34.99 4.329 4.329 #> 6: 1 3.50 1.500 86.03 34.97 4.302 4.302 #> 7: 1 3.75 1.111 85.35 34.98 4.267 4.267 #> 8: 1 4.00 0.823 84.57 35.03 4.229 4.229 mutate_sims(out, label = \"abc\") #> Model: housemodel #> Dim: 482 x 8 #> Time: 0 to 120 #> ID: 1 #> ID time GUT CENT RESP DV CP label #> 1: 1 0.00 0.00 0.00 50.00 0.000 0.000 abc #> 2: 1 0.00 100.00 0.00 50.00 0.000 0.000 abc #> 3: 1 0.25 74.08 25.75 48.68 1.287 1.287 abc #> 4: 1 0.50 54.88 44.50 46.18 2.225 2.225 abc #> 5: 1 0.75 40.66 58.08 43.61 2.904 2.904 abc #> 6: 1 1.00 30.12 67.83 41.38 3.391 3.391 abc #> 7: 1 1.25 22.31 74.74 39.58 3.737 3.737 abc #> 8: 1 1.50 16.53 79.56 38.18 3.978 3.978 abc select_sims(out, RESP, CP) #> Model: housemodel #> Dim: 482 x 4 #> Time: 0 to 120 #> ID: 1 #> ID time RESP CP #> 1: 1 0.00 50.00 0.000 #> 2: 1 0.00 50.00 0.000 #> 3: 1 0.25 48.68 1.287 #> 4: 1 0.50 46.18 2.225 #> 5: 1 0.75 43.61 2.904 #> 6: 1 1.00 41.38 3.391 #> 7: 1 1.25 39.58 3.737 #> 8: 1 1.50 38.18 3.978"},{"path":"https://mrgsolve.org/docs/reference/mrgsolve_package.html","id":null,"dir":"Reference","previous_headings":"","what":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","title":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","text":"mrgsolve R package maintained auspices Metrum Research Group facilitates simulation models based systems ordinary differential equations (ODE) typically employed understanding pharmacokinetics, pharmacodynamics, systems biology pharmacology. mrgsolve consists computer code written R C++ languages, providing interface C++ translation lsoda differential equation solver. See aboutsolver information.","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsolve_package.html","id":"resources","dir":"Reference","previous_headings":"","what":"Resources","title":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","text":"Main mrgsolve resource page: https://mrgsolve.org User guide: https://mrgsolve.org/user_guide/ Package documentation vignettes: https://mrgsolve.org/docs/","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsolve_package.html","id":"package-wide-options","dir":"Reference","previous_headings":"","what":"Package-wide options","title":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","text":"mrgolve.project: sets default project director (mread()) mrgsolve.soloc: sets default package build directory (mread()) mrgsolve_mread_quiet: print messages mread() mrgsolve.update.strict: option deprecated; use strict argument update() instead","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mrgsolve_package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","text":"Maintainer: Kyle T Baron kyleb@metrumrg.com (ORCID) contributors: Bill Gillespie [contributor] Charles Margossian [contributor] Devin Pastoor [contributor] Bill Denney (ORCID) [contributor] Dilawar Singh [contributor] Felicien Le Louedec (ORCID) [contributor] Timothy Waterhouse (ORCID) [contributor] Kyle Meyer [contributor] Metrum Research Group [copyright holder]","code":""},{"path":"https://mrgsolve.org/docs/reference/mrgsolve_package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"mrgsolve: Simulate from ODE-Based Models — mrgsolve-package","text":"","code":"## example(\"mrgsolve\") mod <- mrgsolve::house(delta=0.1) %>% param(CL=0.5) events <- ev(amt=1000, cmt=1, addl=5, ii=24) events #> Events: #> time amt ii addl cmt evid #> 1 0 1000 24 5 1 1 mod #> #> #> -------------- source: housemodel.cpp -------------- #> #> project: /private/var/fol...solve/project #> shared object: mrgsolve #> #> time: start: 0 end: 120 delta: 0.1 #> add: <none> #> compartments: GUT CENT RESP [3] #> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC #> KIN KOUT IC50 WT SEX [14] #> captures: DV CP [2] #> omega: 4x4 #> sigma: 1x1 #> #> solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar) #> ------------------------------------------------------ see(mod) #> #> Model file: housemodel.cpp #> $PROB #> #> # `mrgsolve` housemodel #> #> This model is compiled with `mrgsolve`. #> #> - Author: Metrum Research Group, LLC #> - Description: Generic indirect response PK/PD model #> - Covariates: Weight, female sex #> - Random effects: CL, VC, KA, KOUT #> - Error model: exponential #> #> #> #> $PLUGIN base #> #> $PARAM @annotated #> CL : 1 : Clearance (L/hr) #> VC : 20 : Volume of distribution (L) #> KA : 1.2 : Absorption rate constant (1/hr) #> F1 : 1.0 : Bioavailability fraction (.) #> D1 : 2.0 : Infusion duration (hr) #> WTCL : 0.75 : Exponent WT on CL #> WTVC : 1.00 : Exponent WT on VC #> SEXCL: 0.7 : Prop cov effect on CL #> SEXVC: 0.85 : Prop cov effect on VC #> KIN : 100 : Resp prod rate constant (1/hr) #> KOUT : 2 : Resp elim rate constant (1/hr) #> IC50 : 10 : Conc giving 50% max resp (ng/ml) #> #> $PARAM @annotated @covariates #> WT : 70 : Weight (kg) #> SEX : 0 : Covariate female sex #> #> $CMT @annotated #> GUT : Dosing compartment (mg) #> CENT : Central compartment (mg) #> RESP : Response (unitless) #> #> $OMEGA @labels ECL EVC EKA EKOUT #> 0 0 0 0 #> #> $SIGMA @labels EXPO #> 0 #> #> $SET end=120, delta=0.25 #> #> $GLOBAL #> #define CP (CENT/VCi) #> #define INH (CP/(IC50+CP)) #> #> typedef double localdouble; #> #> $MAIN #> F_GUT = F1; #> D_CENT = D1; #> #> double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL); #> double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC); #> double KAi = exp(log(KA) + EKA); #> double KOUTi = exp(log(KOUT) + EKOUT); #> #> RESP_0 = KIN/KOUTi; #> #> $ODE #> dxdt_GUT = -KAi*GUT; #> dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT; #> dxdt_RESP = KIN*(1-INH) - KOUTi*RESP; #> #> $TABLE #> double DV = CP*exp(EXPO); #> #> $CAPTURE @annotated #> DV: Dependent variable (ng/ml) #> CP: Plasma concentration (ng/ml) if (FALSE) { # \\dontrun{ stime(mod) } # } param(mod) #> #> Model parameters (N=14): #> name value . name value #> CL 0.5 | SEX 0 #> D1 2 | SEXCL 0.7 #> F1 1 | SEXVC 0.85 #> IC50 10 | VC 20 #> KA 1.2 | WT 70 #> KIN 100 | WTCL 0.75 #> KOUT 2 | WTVC 1 init(mod) #> #> Model initial conditions (N=3): #> name value . name value #> CENT (2) 0 | RESP (3) 50 #> GUT (1) 0 | . ... . out <- mod %>% ev(events) %>% mrgsim(end=168) head(out) #> ID time GUT CENT RESP DV CP #> 1 1 0.0 0.0000 0.0000 50.00000 0.000000 0.000000 #> 2 1 0.0 1000.0000 0.0000 50.00000 0.000000 0.000000 #> 3 1 0.1 886.9204 112.9355 48.03655 5.646775 5.646775 #> 4 1 0.2 786.6279 212.8183 44.31899 10.640917 10.640917 #> 5 1 0.3 697.6763 301.1252 40.24379 15.056258 15.056258 #> 6 1 0.4 618.7834 379.1657 36.29753 18.958286 18.958286 tail(out) #> ID time GUT CENT RESP DV CP #> 1677 1 167.5 1.218838e-22 671.4739 11.36504 33.57369 33.57369 #> 1678 1 167.6 1.077788e-22 669.7973 11.38701 33.48987 33.48987 #> 1679 1 167.7 9.538423e-23 668.1249 11.40901 33.40625 33.40625 #> 1680 1 167.8 8.441723e-23 666.4567 11.43104 33.32283 33.32283 #> 1681 1 167.9 7.466555e-23 664.7926 11.45310 33.23963 33.23963 #> 1682 1 168.0 6.610146e-23 663.1327 11.47519 33.15664 33.15664 dim(out) #> [1] 1682 7 plot(out, GUT+CP~.) sims <- as.data.frame(out) t72 <- dplyr::filter(sims, time==72) str(t72) #> 'data.frame':\t1 obs. of 7 variables: #> $ ID : num 1 #> $ time: num 72 #> $ GUT : num 1000 #> $ CENT: num 1037 #> $ RESP: num 8 #> $ DV : num 51.8 #> $ CP : num 51.8 idata <- data.frame(ID=c(1,2,3), CL=c(0.5,1,2),VC=12) out <- mod %>% ev(events) %>% mrgsim(end=168, idata=idata, req=\"\") plot(out) out <- mod %>% ev(events) %>% mrgsim(carry_out=\"amt,evid,cmt,CL\") head(out) #> ID time evid amt cmt GUT CENT RESP DV CP #> 1 1 0.0 0 0 0 0.0000 0.0000 50.00000 0.000000 0.000000 #> 2 1 0.0 1 1000 1 1000.0000 0.0000 50.00000 0.000000 0.000000 #> 3 1 0.1 0 0 0 886.9204 112.9355 48.03655 5.646775 5.646775 #> 4 1 0.2 0 0 0 786.6279 212.8183 44.31899 10.640917 10.640917 #> 5 1 0.3 0 0 0 697.6763 301.1252 40.24379 15.056258 15.056258 #> 6 1 0.4 0 0 0 618.7834 379.1657 36.29753 18.958286 18.958286 ev1 <- ev(amt=500, cmt=2,rate=10) ev2 <- ev(amt=100, cmt=1, time=54, ii=8, addl=10) events <- c(ev1+ev2) events #> Events: #> time amt rate cmt evid ii addl #> 1 0 500 10 2 1 0 0 #> 2 54 100 0 1 1 8 10 out <- mod %>% ev(events) %>% mrgsim(end=180, req=\"\") plot(out) ## \"Condensed\" data set data(extran1) extran1 #> ID amt cmt time addl ii rate evid #> 1 1 1000 1 0 3 24 0 1 #> 2 2 1000 2 0 0 0 20 1 #> 3 3 1000 1 0 0 0 0 1 #> 4 3 500 1 24 0 0 0 1 #> 5 3 500 1 48 0 0 0 1 #> 6 3 1000 1 72 0 0 0 1 #> 7 4 2000 2 0 2 48 100 1 #> 8 5 1000 1 0 0 0 0 1 #> 9 5 5000 1 24 0 0 60 1 out <- mod %>% data_set(extran1) %>% mrgsim(end=200) plot(out,CP~time|factor(ID)) ## idata data(exidata) out <- mod %>% ev(amt=1000, cmt=1) %>% idata_set(exidata) %>% mrgsim(end=72) plot(out, CP~., as=\"log10\") #> Warning: In subset.data.frame(as.data.frame(x), ...) : #> extra argument ‘as’ will be disregarded # Internal model library if (FALSE) { # \\dontrun{ mod <- mread(\"irm1\", modlib()) mod x <- mod %>% ev(amt=300, ii=12, addl=3) %>% mrgsim } # }"},{"path":"https://mrgsolve.org/docs/reference/mvgauss.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate from a multivariate normal distribution with mean zero — mvgauss","title":"Simulate from a multivariate normal distribution with mean zero — mvgauss","text":"Simulate multivariate normal distribution mean zero","code":""},{"path":"https://mrgsolve.org/docs/reference/mvgauss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate from a multivariate normal distribution with mean zero — mvgauss","text":"","code":"mvgauss(mat, n = 10, seed = NULL)"},{"path":"https://mrgsolve.org/docs/reference/mvgauss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate from a multivariate normal distribution with mean zero — mvgauss","text":"mat positive-definite matrix n number variates simulate seed null, passed set.seed","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":null,"dir":"Reference","previous_headings":"","what":"Write a model to native mrgsolve format — mwrite_cpp","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"Model code written file native mrgsolve format. can useful (1) breaking connection NONMEM modeling outputs imported $NMXML $NMEXT (2) saving model updates (e.g., updated parameter list). Models can read back using mread().","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"","code":"mwrite_cpp(x, file, update = TRUE)"},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"x model object. file output file name; non-character (e.g., NULL), output written file. update TRUE model settings written cpp file $SET block.","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"list containing data written cpp file, added item file, returned invisibly.","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"See important details mwrite_yaml().","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mwrite_cpp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write a model to native mrgsolve format — mwrite_cpp","text":"","code":"temp <- tempfile(fileext = \".mod\") mod <- modlib(\"pk1\", compile = FALSE) x <- mwrite_cpp(mod, file = temp) mod <- mread(x$file, compile = FALSE) mod #> #> #> ---------- source: file1661c3600664e.mod ---------- #> #> project: /private/var/fol.../T/RtmpRwrIeP #> shared object: file1661c3600664e.mod-so-1661c7ac700d9 <not loaded> #> #> time: start: 0 end: 24 delta: 1 #> add: <none> #> compartments: EV CENT [2] #> parameters: CL V KA [3] #> captures: CP [1] #> omega: 0x0 #> sigma: 0x0 #> #> solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar) #> ------------------------------------------------------"},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":null,"dir":"Reference","previous_headings":"","what":"Write model code to yaml format — mwrite_yaml","title":"Write model code to yaml format — mwrite_yaml","text":"Model code written readable, transport format. transport format can useful (1) breaking connection NONMEM modeling outputs imported $NMXML $NMEXT (2) saving model updates (e.g., updated parameter list). Models can read back using mread_yaml() converted mrgsolve cpp format yaml_to_cpp().","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write model code to yaml format — mwrite_yaml","text":"","code":"mwrite_yaml(x, file, digits = 8)"},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write model code to yaml format — mwrite_yaml","text":"x model object. file output file name; non-character (e.g., NULL), output written file. digits precision use writing outputs.","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write model code to yaml format — mwrite_yaml","text":"list containing data written yaml file, added item file, returned invisibly.","code":""},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write model code to yaml format — mwrite_yaml","text":"Parameters omega sigma matrices imported via $NMXML $NMEXT written yaml file NONMEM import blocks dropped. allows user load model based NONMEM run without connection output (e.g., root.xml root.ext). Given connection NONMEM modeling outputs broken writing yaml, update NONMEM run propagated yaml file mwrite_yaml() run . yaml file currently ability track external dependencies, user-defined header files code might sourced user model loaded via mread(). NONMEM xml ext files imported $NMXML $NMEXT external dependencies accounted yaml transport file.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/mwrite_yaml.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write model code to yaml format — mwrite_yaml","text":"","code":"mod <- house() temp1 <- tempfile(fileext = \".yaml\") x <- mwrite_yaml(mod, temp1) readLines(temp1) #> [1] \"source: mrgsolve::mwrite\" #> [2] \"mrgsolve: 1.6.1\" #> [3] \"format: yaml\" #> [4] \"version: 1.0\" #> [5] \"model: housemodel\" #> [6] \"prob:\" #> [7] \"- '# `mrgsolve` housemodel'\" #> [8] \"- This model is compiled with `mrgsolve`.\" #> [9] \"- ' - Author: Metrum Research Group, LLC'\" #> [10] \"- ' - Description: Generic indirect response PK/PD model'\" #> [11] \"- ' - Covariates: Weight, female sex'\" #> [12] \"- ' - Random effects: CL, VC, KA, KOUT'\" #> [13] \"- ' - Error model: exponential'\" #> [14] \"- ''\" #> [15] \"- '# Model Annotations: '\" #> [16] \"- ''\" #> [17] \"- 'block name descr unit '\" #> [18] \"- '-------- ------ ------------------------- ---------'\" #> [19] \"- 'PARAM CL Clearance L/hr '\" #> [20] \"- 'PARAM VC Volume of distribution L '\" #> [21] \"- 'PARAM KA Absorption rate constant 1/hr '\" #> [22] \"- 'PARAM F1 Bioavailability fraction . '\" #> [23] \"- 'PARAM D1 Infusion duration hr '\" #> [24] \"- 'PARAM WTCL Exponent WT on CL . '\" #> [25] \"- 'PARAM WTVC Exponent WT on VC . '\" #> [26] \"- 'PARAM SEXCL Prop cov effect on CL . '\" #> [27] \"- 'PARAM SEXVC Prop cov effect on VC . '\" #> [28] \"- 'PARAM KIN Resp prod rate constant 1/hr '\" #> [29] \"- 'PARAM KOUT Resp elim rate constant 1/hr '\" #> [30] \"- 'PARAM IC50 Conc giving 50% max resp ng/ml '\" #> [31] \"- 'PARAM WT Weight kg '\" #> [32] \"- 'PARAM SEX Covariate female sex . '\" #> [33] \"- 'CMT GUT Dosing compartment mg '\" #> [34] \"- 'CMT CENT Central compartment mg '\" #> [35] \"- 'CMT RESP Response unitless '\" #> [36] \"- 'CAPTURE DV Dependent variable ng/ml '\" #> [37] \"- 'CAPTURE CP Plasma concentration ng/ml '\" #> [38] \"param:\" #> [39] \" CL: 1.0\" #> [40] \" VC: 20.0\" #> [41] \" KA: 1.2\" #> [42] \" F1: 1.0\" #> [43] \" D1: 2.0\" #> [44] \" WTCL: 0.75\" #> [45] \" WTVC: 1.0\" #> [46] \" SEXCL: 0.7\" #> [47] \" SEXVC: 0.85\" #> [48] \" KIN: 100.0\" #> [49] \" KOUT: 2.0\" #> [50] \" IC50: 10.0\" #> [51] \" WT: 70.0\" #> [52] \" SEX: 0.0\" #> [53] \"init:\" #> [54] \" GUT: 0.0\" #> [55] \" CENT: 0.0\" #> [56] \" RESP: 50.0\" #> [57] \"capture:\" #> [58] \"- DV\" #> [59] \"- CP\" #> [60] \"omega:\" #> [61] \" data:\" #> [62] \" matrix1:\" #> [63] \" row1: 0.0\" #> [64] \" row2:\" #> [65] \" - 0.0\" #> [66] \" - 0.0\" #> [67] \" row3:\" #> [68] \" - 0.0\" #> [69] \" - 0.0\" #> [70] \" - 0.0\" #> [71] \" row4:\" #> [72] \" - 0.0\" #> [73] \" - 0.0\" #> [74] \" - 0.0\" #> [75] \" - 0.0\" #> [76] \" labels:\" #> [77] \" matrix1:\" #> [78] \" - ECL\" #> [79] \" - EVC\" #> [80] \" - EKA\" #> [81] \" - EKOUT\" #> [82] \" names: '...'\" #> [83] \"sigma:\" #> [84] \" data:\" #> [85] \" matrix1:\" #> [86] \" row1: 0.0\" #> [87] \" labels:\" #> [88] \" matrix1: EXPO\" #> [89] \" names: '...'\" #> [90] \"envir: []\" #> [91] \"plugin: base\" #> [92] \"update:\" #> [93] \" start: 0.0\" #> [94] \" end: 120.0\" #> [95] \" delta: 0.25\" #> [96] \" add: []\" #> [97] \" atol: 1.0e-08\" #> [98] \" rtol: 1.0e-08\" #> [99] \" ss_atol: 1.0e-08\" #> [100] \" ss_rtol: 1.0e-08\" #> [101] \" maxsteps: 20000.0\" #> [102] \" hmax: 0.0\" #> [103] \" hmin: 0.0\" #> [104] \" mxhnil: 2.0\" #> [105] \" ixpr: 0.0\" #> [106] \" mindt: 2.22044605e-15\" #> [107] \" digits: -1.0\" #> [108] \" tscale: 1.0\" #> [109] \" outvars:\" #> [110] \" - GUT\" #> [111] \" - CENT\" #> [112] \" - RESP\" #> [113] \" - DV\" #> [114] \" - CP\" #> [115] \"set:\" #> [116] \" end: 120.0\" #> [117] \" delta: 0.25\" #> [118] \"code:\" #> [119] \"- $PLUGIN\" #> [120] \"- base\" #> [121] \"- ' '\" #> [122] \"- $GLOBAL\" #> [123] \"- '#define CP (CENT/VCi)'\" #> [124] \"- '#define INH (CP/(IC50+CP))'\" #> [125] \"- typedef double localdouble;\" #> [126] \"- ' '\" #> [127] \"- $MAIN\" #> [128] \"- F_GUT = F1;\" #> [129] \"- D_CENT = D1;\" #> [130] \"- double CLi = exp(log(CL) + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL);\" #> [131] \"- double VCi = exp(log(VC) + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC);\" #> [132] \"- double KAi = exp(log(KA) + EKA);\" #> [133] \"- double KOUTi = exp(log(KOUT) + EKOUT);\" #> [134] \"- RESP_0 = KIN/KOUTi;\" #> [135] \"- ' '\" #> [136] \"- $ODE\" #> [137] \"- dxdt_GUT = -KAi*GUT;\" #> [138] \"- dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT;\" #> [139] \"- dxdt_RESP = KIN*(1-INH) - KOUTi*RESP;\" #> [140] \"- ' '\" #> [141] \"- $TABLE\" #> [142] \"- double DV = CP*exp(EXPO);\" #> [143] \"- ' '\""},{"path":"https://mrgsolve.org/docs/reference/names-mrgmod-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Get all names from a model object — names,mrgmod-method","title":"Get all names from a model object — names,mrgmod-method","text":"Get names model object","code":""},{"path":"https://mrgsolve.org/docs/reference/names-mrgmod-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get all names from a model object — names,mrgmod-method","text":"","code":"# S4 method for class 'mrgmod' names(x)"},{"path":"https://mrgsolve.org/docs/reference/names-mrgmod-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get all names from a model object — names,mrgmod-method","text":"x model object","code":""},{"path":"https://mrgsolve.org/docs/reference/names-mrgmod-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get all names from a model object — names,mrgmod-method","text":"","code":"mod <- mrgsolve::house() names(mod) #> $param #> [1] \"CL\" \"VC\" \"KA\" \"F1\" \"D1\" \"WTCL\" \"WTVC\" \"SEXCL\" \"SEXVC\" #> [10] \"KIN\" \"KOUT\" \"IC50\" \"WT\" \"SEX\" #> #> $init #> [1] \"GUT\" \"CENT\" \"RESP\" #> #> $capture #> [1] \"DV\" \"CP\" #> #> $omega #> [1] \"...\" #> #> $sigma #> [1] \"...\" #> #> $omega_labels #> $omega_labels[[1]] #> [1] \"ECL\" \"EVC\" \"EKA\" \"EKOUT\" #> #> #> $sigma_labels #> $sigma_labels[[1]] #> [1] \"EXPO\" #> #>"},{"path":"https://mrgsolve.org/docs/reference/nmext.html","id":null,"dir":"Reference","previous_headings":"","what":"Import model estimates from a NONMEM ext file — nmext","title":"Import model estimates from a NONMEM ext file — nmext","text":"Import model estimates NONMEM ext file","code":""},{"path":"https://mrgsolve.org/docs/reference/nmext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import model estimates from a NONMEM ext file — nmext","text":"","code":"nmext( run = NA_real_, project = getwd(), file = paste0(run, \".ext\"), path = NULL, root = c(\"working\", \"cppfile\"), index = \"last\", theta = TRUE, omega = TRUE, sigma = TRUE, olabels = NULL, slabels = NULL, oprefix = \"\", sprefix = \"\", tname = \"THETA\", oname = \"...\", sname = \"...\", read_fun = \"data.table\", env = NULL )"},{"path":"https://mrgsolve.org/docs/reference/nmext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import model estimates from a NONMEM ext file — nmext","text":"run run number. project project directory. file deprecated; use path instead. path full path NONMEM ext file. root directory path project relative ; currently limited working directory cppdir, directory model file located. index estimation number return; \"last\" return last estimation results; otherwise, pass integer indicating estimation results return. theta logical; TRUE, $THETA vector returned. omega logical; TRUE, $OMEGA matrix returned. sigma logical; TRUE, $SIGMA matrix returned. olabels labels $OMEGA. slabels labels $SIGMA. oprefix prefix $OMEGA labels. sprefix prefix $SIGMA labels. tname name $THETA. oname name $OMEGA. sname name $SIGMA. read_fun function use reading ext file. env internal use .","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/numeric2diag.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a diagonal numeric matrix from diagonal elements — numeric2diag","title":"Create a diagonal numeric matrix from diagonal elements — numeric2diag","text":"Create diagonal numeric matrix diagonal elements","code":""},{"path":"https://mrgsolve.org/docs/reference/numeric2diag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a diagonal numeric matrix from diagonal elements — numeric2diag","text":"","code":"numeric2diag(x, context = NULL)"},{"path":"https://mrgsolve.org/docs/reference/numeric2diag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a diagonal numeric matrix from diagonal elements — numeric2diag","text":"x numeric data context used generate column names","code":""},{"path":"https://mrgsolve.org/docs/reference/numeric2diag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a diagonal numeric matrix from diagonal elements — numeric2diag","text":"numeric diagonal matrix","code":""},{"path":"https://mrgsolve.org/docs/reference/numericlist-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 class numeric list — numericlist-class","title":"S4 class numeric list — numericlist-class","text":"S4 class numeric list","code":""},{"path":"https://mrgsolve.org/docs/reference/numericlist-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S4 class numeric list — numericlist-class","text":"data list data pattern character length 1 containing regular expression used filter printing data console","code":""},{"path":"https://mrgsolve.org/docs/reference/numericlist.html","id":null,"dir":"Reference","previous_headings":"","what":"Methods for numericlist — numericlist","title":"Methods for numericlist — numericlist","text":"methods can used coerce param init objects common R data structures, extract elements numericlists, get attributes numericlists.","code":""},{"path":"https://mrgsolve.org/docs/reference/numericlist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Methods for numericlist — numericlist","text":"","code":"# S4 method for class 'numericlist' as.list(x, ...) # S4 method for class 'numericlist' as.numeric(x) # S4 method for class 'numericlist' as.data.frame(x, row.names = NULL, optional = FALSE, ...) # S4 method for class 'numericlist' length(x) # S4 method for class 'numericlist' names(x) # S4 method for class 'numericlist' x$name # S4 method for class 'numericlist' x[[i, ..., exact = TRUE]] # S4 method for class 'numericlist' x[i, j, ..., drop = TRUE]"},{"path":"https://mrgsolve.org/docs/reference/numericlist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Methods for numericlist — numericlist","text":"x object ... passed along methods row.names passed .data.frame optional passed .data.frame name column take elements keep exact used j used drop used","code":""},{"path":"https://mrgsolve.org/docs/reference/numerics_only.html","id":null,"dir":"Reference","previous_headings":"","what":"Prepare data.frame for input to mrgsim() — numerics_only","title":"Prepare data.frame for input to mrgsim() — numerics_only","text":"Prepare data.frame input mrgsim()","code":""},{"path":"https://mrgsolve.org/docs/reference/numerics_only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prepare data.frame for input to mrgsim() — numerics_only","text":"","code":"numerics_only(x, quiet = FALSE, convert_lgl = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/numerics_only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prepare data.frame for input to mrgsim() — numerics_only","text":"x input data set. quiet logical indicating whether warnings printed. convert_lgl TRUE, convert logical columns .integer().","code":""},{"path":"https://mrgsolve.org/docs/reference/obsaug.html","id":null,"dir":"Reference","previous_headings":"","what":"Augment observations in the simulated output — obsaug","title":"Augment observations in the simulated output — obsaug","text":"Augment observations simulated output","code":""},{"path":"https://mrgsolve.org/docs/reference/obsaug.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Augment observations in the simulated output — obsaug","text":"","code":"obsaug(x, value = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/obsaug.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Augment observations in the simulated output — obsaug","text":"x model object value value obsaug ... passed along also obsaug argument mrgsim can set accomplish thing call obsaug pipeline.","code":""},{"path":"https://mrgsolve.org/docs/reference/obsonly.html","id":null,"dir":"Reference","previous_headings":"","what":"Collect only observation records in the simulated output — obsonly","title":"Collect only observation records in the simulated output — obsonly","text":"Collect observation records simulated output","code":""},{"path":"https://mrgsolve.org/docs/reference/obsonly.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collect only observation records in the simulated output — obsonly","text":"","code":"obsonly(x, value = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/obsonly.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collect only observation records in the simulated output — obsonly","text":"x model object. value use `TRUE` collect return observation records . ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/obsonly.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collect only observation records in the simulated output — obsonly","text":"also `obsonly` argument [mrgsim()] can set accomplish thing call `obsonly()` pipeline.","code":""},{"path":"https://mrgsolve.org/docs/reference/outvars.html","id":null,"dir":"Reference","previous_headings":"","what":"Show names of current output variables — outvars","title":"Show names of current output variables — outvars","text":"Outputs can include model compartments variables defined model marked capture simulated output.","code":""},{"path":"https://mrgsolve.org/docs/reference/outvars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show names of current output variables — outvars","text":"","code":"outvars(x, unlist = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/outvars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show names of current output variables — outvars","text":"x model object. unlist TRUE character vector (rather list) returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/outvars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show names of current output variables — outvars","text":"unlist FALSE (default) : named list, cmt showing names output compartments capture giving names output variables capture. unlist TRUE, single, unnamed character vector outvar names returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/outvars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show names of current output variables — outvars","text":"","code":"mod <- mrgsolve::house() outvars(mod) #> $cmt #> [1] \"GUT\" \"CENT\" \"RESP\" #> #> $capture #> [1] \"DV\" \"CP\" #>"},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":null,"dir":"Reference","previous_headings":"","what":"Return parameter tags — param_tags","title":"Return parameter tags — param_tags","text":"Use function added @covariates @input attributes specified user-defined tag (via @tag) one parameter blocks need extract information. Also, using $INPUT block declare parameters automatically add input tag (via @input). attributes / tags added, can use check_data_names() reconcile names input data sets tagged model parameters.","code":""},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return parameter tags — param_tags","text":"","code":"param_tags(x)"},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return parameter tags — param_tags","text":"x mrgsolve model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return parameter tags — param_tags","text":"data frame listing parameter names tags.","code":""},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":"model-specification","dir":"Reference","previous_headings":"","what":"Model specification","title":"Return parameter tags — param_tags","text":"Note: good practice tag parameters appropriate input covariates automatically expected input data call check_data_names(). User-defined tags also possible, need alert check_data_names() look . Model Specification Examples can use $INPUT block add input tag parameters Tag covariates model user-defined tag","code":"$INPUT STUDY = 101, WT = 70, DVID = 1 $PARAM @covariates WT = 70, SEX = 1, EGFR = 110 $PARAM @tag flags FFLAG = 1, DFLAG = 0"},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/param_tags.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return parameter tags — param_tags","text":"","code":"mod <- mrgsolve::house() param_tags(mod) #> name tag #> 1 WT covariates #> 2 SEX covariates"},{"path":"https://mrgsolve.org/docs/reference/parameter_list-class.html","id":null,"dir":"Reference","previous_headings":"","what":"S4 parameter_list class — parameter_list-class","title":"S4 parameter_list class — parameter_list-class","text":"S4 parameter_list class","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_batch_mrgsims.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot method for mrgsims objects — plot,batch_mrgsims,missing-method","title":"Plot method for mrgsims objects — plot,batch_mrgsims,missing-method","text":"Plot method mrgsims objects","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_batch_mrgsims.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot method for mrgsims objects — plot,batch_mrgsims,missing-method","text":"","code":"# S4 method for class 'batch_mrgsims,missing' plot(x, yval = variables(x), auto.key = list(), mincol = 3, ...) # S4 method for class 'batch_mrgsims,formula' plot( x, y, show.grid = TRUE, lwd = 2, type = \"l\", yval = variables(x), auto.key = list(columns = 1), scales = list(y = list(relation = \"free\")), ... )"},{"path":"https://mrgsolve.org/docs/reference/plot_batch_mrgsims.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot method for mrgsims objects — plot,batch_mrgsims,missing-method","text":"x mrgsims object yval y variables plot auto.key passed xyplot mincol minimum number columns key ... arguments passed xyplot y formula passed xyplot show.grid print grid plot lwd passed xyplot type passed xyplot scales passed xyplot","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_mrgsims.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a quick plot of simulated data — plot_mrgsims","title":"Generate a quick plot of simulated data — plot_mrgsims","text":"Generate quick plot simulated data","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_mrgsims.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a quick plot of simulated data — plot_mrgsims","text":"","code":"# S4 method for class 'mrgsims,missing' plot(x, limit = 16, ...) # S4 method for class 'mrgsims,formula' plot( x, y, limit = 16, show.grid = TRUE, outer = TRUE, type = \"l\", lwd = 2, ylab = \"value\", groups = ID, scales = list(y = list(relation = \"free\")), logy = FALSE, logbr = 1, ... ) # S4 method for class 'mrgsims,character' plot(x, y, ...)"},{"path":"https://mrgsolve.org/docs/reference/plot_mrgsims.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a quick plot of simulated data — plot_mrgsims","text":"x mrgsims object limit limit number panels create ... arguments passed xyplot y formula used plotting show.grid logical indicating whether draw panel.grid outer passed xyplot type passed xyplot lwd passed xyplot ylab passed xyplot groups passed xyplot scales passed xyplot logy plot y variables log scale logbr log scale breaks indicator; use 1 breaks every log unit; use 3 breaks every half log unit; use 0 default breaks","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_mrgsims.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a quick plot of simulated data — plot_mrgsims","text":"","code":"mod <- mrgsolve::house(end=48, delta=0.2) %>% init(GUT=1000) out <- mrgsim(mod) plot(out) plot(out, subset=time <=24) plot(out, GUT+CP~.) plot(out, CP+RESP~time, col=\"black\", scales=\"same\", lty=2) #> Warning: In subset.data.frame(as.data.frame(x), ...) : #> extra arguments ‘col’, ‘lty’ will be disregarded if (FALSE) { # \\dontrun{ plot(out, \"CP RESP, GUT\") } # }"},{"path":"https://mrgsolve.org/docs/reference/plot_sims.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot data as an mrgsims object — plot_sims","title":"Plot data as an mrgsims object — plot_sims","text":"Plot data mrgsims object","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_sims.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot data as an mrgsims object — plot_sims","text":"","code":"plot_sims(.data, ..., .f = NULL, .dots = list())"},{"path":"https://mrgsolve.org/docs/reference/plot_sims.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot data as an mrgsims object — plot_sims","text":".data data frame ... unquoted column names plot y-axis .f formula plot .dots extra arguments passed lattice::xyplot","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_sims.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot data as an mrgsims object — plot_sims","text":"function intended use data frames created modifying mrgsims object.","code":""},{"path":"https://mrgsolve.org/docs/reference/plot_sims.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot data as an mrgsims object — plot_sims","text":"","code":"mod <- mrgsolve::house() %>% ev(amt = 100) out <- mrgsim(mod) out_df <- dplyr::mutate(out, time <= 72) plot(out) plot_sims(out, CP, RESP) if (FALSE) { # \\dontrun{ plot_sims(out, .f = ~ CP + RESP) plot_sims(out, .f = CP + RESP ~ time) } # }"},{"path":"https://mrgsolve.org/docs/reference/qsim.html","id":null,"dir":"Reference","previous_headings":"","what":"Basic, simple simulation from model object — qsim","title":"Basic, simple simulation from model object — qsim","text":"just lighter version mrgsim(), fewer options better efficiency certain cases. See Details.","code":""},{"path":"https://mrgsolve.org/docs/reference/qsim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Basic, simple simulation from model object — qsim","text":"","code":"qsim( x, data, idata = no_idata_set(), obsonly = FALSE, tgrid = NULL, recsort = 1, tad = FALSE, Req = NULL, outvars = Req, skip_init_calc = FALSE, output = \"mrgsims\" )"},{"path":"https://mrgsolve.org/docs/reference/qsim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Basic, simple simulation from model object — qsim","text":"x model object. data can either event object data set. idata matrix data frame model parameters, one parameter per row (see idata_set()). obsonly TRUE, dosing records included output. tgrid tgrid object; numeric vector simulation times another object stime method. recsort record sorting flag. Default value 1. Possible values 1,2,3,4: 1 2 put doses data set padded observations time; 3 4 put doses padded observations time. 2 4 put doses scheduled addl observations time; 1 3 put doses scheduled addl observations time. recsort change order input data set doses observations given. tad TRUE column added simulated output added showing time since last dose. data records evid == 1 considered doses purposes tad calculation. tad can properly calculated dosing lag time model long dosing lag time (specified $MAIN) always appropriate subsequent doses scheduled addl. always true lag time change time. might (possibly) hold lag time changes prior last dose addl sequence. known limitation affect tad calculation common dosing lag time implementations. Req synonym outvars. outvars output items request; missing, captured items returned output. skip_init_calc use $MAIN calculate initial conditions. output output data type; default mrgsims, returns default output object; options include df (data.frame) matrix.","code":""},{"path":"https://mrgsolve.org/docs/reference/qsim.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Basic, simple simulation from model object — qsim","text":"qsim() mainly cuts overhead simulation. , primary efficiency gain using qsim() comes simulation executes quickly. unlikely see big performance difference qsim() mrgsim() model difficult solve large input data set. pipeline interface function; configuration options (see Arguments) must passed formal arguments function. carry_out, Request specific columns, pass items update. limitations, convenience-related. See Arguments available options. Specifically, ... argument function. Use update() method update model object.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/qsim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Basic, simple simulation from model object — qsim","text":"","code":"mod <- mrgsolve::house() dose <- ev(amt = 100) out <- qsim(mod,dose)"},{"path":"https://mrgsolve.org/docs/reference/read_nmext.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract estimates from NONMEM ext file — read_nmext","title":"Extract estimates from NONMEM ext file — read_nmext","text":"function retrieves NONMEM estimates use mrgsolve model $NMEXT invoked. See nmext().","code":""},{"path":"https://mrgsolve.org/docs/reference/read_nmext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract estimates from NONMEM ext file — read_nmext","text":"","code":"read_nmext( run = NA_real_, project = getwd(), file = paste0(run, \".ext\"), path = NULL, read_fun = c(\"data.table\", \"read.table\"), index = \"last\" )"},{"path":"https://mrgsolve.org/docs/reference/read_nmext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract estimates from NONMEM ext file — read_nmext","text":"run run number run identifier. project NONMEM project directory. file ext file name. path full path file name ext file. read_fun function read ext file; data.table::fread() used available; otherwise utils::read.table() used. index selects table number whose results returned; use value \"last\" select last table .ext file; pass integer specifying table number; case exactly one table .ext file, pass value \"single\" bypass parsing file look sub tables (might useful BAYES analysis performed estimation method 10000s posterior samples file).","code":""},{"path":"https://mrgsolve.org/docs/reference/read_nmext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract estimates from NONMEM ext file — read_nmext","text":"list param, omega, sigma format ready used update model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/read_nmext.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract estimates from NONMEM ext file — read_nmext","text":"","code":"project <- system.file(\"nonmem\", package = \"mrgsolve\") est <- read_nmext(1005, project = project) est$param #> $THETA1 #> [1] 9.50789 #> #> $THETA2 #> [1] 22.791 #> #> $THETA3 #> [1] 0.0714337 #> #> $THETA4 #> [1] 3.47451 #> #> $THETA5 #> [1] 113.277 #> #> $THETA6 #> [1] 1.02435 #> #> $THETA7 #> [1] 1.19212 #> est$omega #> [,1] [,2] [,3] #> [1,] 0.2138790 0.1207700 -0.0116278 #> [2,] 0.1207700 0.0945105 -0.0372064 #> [3,] -0.0116278 -0.0372064 0.0465631 est$sigma #> [,1] [,2] #> [1,] 0.0491707 0.000000 #> [2,] 0.0000000 0.201769 est <- read_nmext(2005, project = project, index = 3)"},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":null,"dir":"Reference","previous_headings":"","what":"Make addl doses explicit in an event object or data set — realize_addl","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"doses scheduled ii addl, object expanded include one record every dose. result, record ii addl set non-zero value.","code":""},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"","code":"realize_addl(x, ...) # S3 method for class 'data.frame' realize_addl( x, warn = FALSE, mark_new = FALSE, fill = c(\"inherit\", \"na\", \"locf\"), ... ) # S3 method for class 'ev' realize_addl(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"x data_set data frame event object (see Details). ... used. warn TRUE warning issued ADDL addl column found. mark_new TRUE, flag added indicate new columns. fill specifies handle non-dose related data columns new data set records; option critical handling data sets time-varying, non-dose-related data items; see Details.","code":""},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"data.frame event object, consistent type x. ii addl columns set zero. result always ungrouped.","code":""},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"addl column found data frame returned warning issued warn true. ii, time, evid missing, error generated. grouped data.frame (via dplyr::group_by()) passed, ungrouped. Use caution passing data non-dose-related data columns vary within subject pay special attention fill argument. definition, realize_addl() add new rows data frame obvious non-dose-related data handled new rows. inherit chosen, new records non-dose-related data identical originating dose record. fine data items varying time, present problem data varying time. locf chosen, missing data filled NA last observation carry forward operation applied every column data set. may want already missing values input data set want preserve missingness. na chosen, missing data filled NA locf operation applied. note missing values may problematic mrgsolve simulation run. time-varying columns missing data data set, sure check output function expecting.","code":""},{"path":"https://mrgsolve.org/docs/reference/realize_addl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make addl doses explicit in an event object or data set — realize_addl","text":"","code":"e <- ev(amt = 100, ii = 12, addl = 3) realize_addl(e) #> Events: #> time amt ii addl cmt evid #> 1 0 100 0 0 1 1 #> 2 12 100 0 0 1 1 #> 3 24 100 0 0 1 1 #> 4 36 100 0 0 1 1 a <- ev(amt = 100, ii = 12, addl = 2, WT = 69) b <- ev(amt = 200, ii = 24, addl = 2, WT = 70) c <- ev(amt = 50, ii = 6, addl = 2, WT = 71) e <- ev_seq(a,b,c) realize_addl(e, mark_new = TRUE) #> Events: #> time amt ii addl cmt evid WT .addl_row_ #> 1 0 100 0 0 1 1 69 0 #> 2 12 100 0 0 1 1 69 1 #> 3 24 100 0 0 1 1 69 1 #> 4 36 200 0 0 1 1 70 0 #> 5 60 200 0 0 1 1 70 1 #> 6 84 200 0 0 1 1 70 1 #> 7 108 50 0 0 1 1 71 0 #> 8 114 50 0 0 1 1 71 1 #> 9 120 50 0 0 1 1 71 1"},{"path":"https://mrgsolve.org/docs/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. dplyr filter","code":""},{"path":"https://mrgsolve.org/docs/reference/render.html","id":null,"dir":"Reference","previous_headings":"","what":"Render a model to a document — render","title":"Render a model to a document — render","text":"Render model document","code":""},{"path":"https://mrgsolve.org/docs/reference/render.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Render a model to a document — render","text":"","code":"render(x, ...) # S4 method for class 'character' render(x, project = NULL, ...) # S4 method for class 'mrgmod' render(x, ...) dorender(model, project, template = NULL, compile = TRUE, ...)"},{"path":"https://mrgsolve.org/docs/reference/render.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Render a model to a document — render","text":"x model object model name ... passed rmarkdown::render project directory containing .cpp model file model model name template template document compile logical; true, model compiled run","code":""},{"path":"https://mrgsolve.org/docs/reference/render.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Render a model to a document — render","text":"","code":"if (FALSE) { # \\dontrun{ mod <- mrgsolve::house() mrgsolve:::render(mod) mrgsolve:::render(\"irm2\", modlib()) } # }"},{"path":"https://mrgsolve.org/docs/reference/reserved.html","id":null,"dir":"Reference","previous_headings":"","what":"Reserved words — reserved","title":"Reserved words — reserved","text":"Reserved words","code":""},{"path":"https://mrgsolve.org/docs/reference/reserved.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reserved words — reserved","text":"","code":"reserved()"},{"path":"https://mrgsolve.org/docs/reference/reserved.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reserved words — reserved","text":"Note: function exported; must go mrgsolve namespace using mrgsolve::: prefix.","code":""},{"path":"https://mrgsolve.org/docs/reference/reserved.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reserved words — reserved","text":"","code":"mrgsolve:::reserved() #> ID #> amt #> cmt #> ii #> ss #> evid #> addl #> rate #> time #> SOLVERTIME #> table #> ETA #> EPS #> AMT #> CMT #> ID #> TIME #> EVID #> simeps #> self #> simeta #> NEWIND #> DONE #> CFONSTOP #> DXDTZERO #> CFONSTOP #> INITSOLV #> _F #> _R #> _ALAG #> SETINIT #> report #> _VARS_ #> VARS #> SS_ADVANCE #> END_OF_INFUSION #> AMT #> CMT #> II #> SS #> ADDL #> RATE #> THETA #> pred_CL #> pred_VC #> pred_V #> pred_V2 #> pred_KA #> pred_Q #> pred_VP #> pred_V3 #> double #> int #> bool #> capture #> until #> now"},{"path":"https://mrgsolve.org/docs/reference/reset_tol.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset all model tolerances — reset_tol","title":"Reset all model tolerances — reset_tol","text":"functions reset scalar customized values relative absolute tolerances. functions reset tolerances single, common rtol atol. functions change tolerance configuration used simulation (e.g., scalar customized); see use_custom_tol() use_scalar_tol() make change model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/reset_tol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset all model tolerances — reset_tol","text":"","code":"reset_tol(x, rtol = NULL, atol = NULL) reset_rtol(x, rtol = NULL) reset_atol(x, atol = NULL)"},{"path":"https://mrgsolve.org/docs/reference/reset_tol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reset all model tolerances — reset_tol","text":"x model object. rtol global relative tolerance scalar customized configurations; supplied, current model's scalar rtol value used. atol global absolute tolerance scalar customized configurations; supplied, current model's scalar atol value used.","code":""},{"path":"https://mrgsolve.org/docs/reference/reset_tol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reset all model tolerances — reset_tol","text":"updated model object.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/reset_tol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset all model tolerances — reset_tol","text":"","code":"mod <- house() mod <- reset_tol(mod, rtol = 1e-6, atol = 1e-10) mod #> #> #> -------------- source: housemodel.cpp -------------- #> #> project: /private/var/fol...solve/project #> shared object: mrgsolve #> #> time: start: 0 end: 120 delta: 0.25 #> add: <none> #> compartments: GUT CENT RESP [3] #> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC #> KIN KOUT IC50 WT SEX [14] #> captures: DV CP [2] #> omega: 4x4 #> sigma: 1x1 #> #> solver: rtol: 1e-06 atol: 1e-10 itol: 1 (scalar) #> ------------------------------------------------------"},{"path":"https://mrgsolve.org/docs/reference/revar.html","id":null,"dir":"Reference","previous_headings":"","what":"Get model random effect variances and covariances — revar","title":"Get model random effect variances and covariances — revar","text":"Use function extract OMEGA SIGMA matrices model object. Typical use display R console.","code":""},{"path":"https://mrgsolve.org/docs/reference/revar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get model random effect variances and covariances — revar","text":"","code":"revar(x, ...) # S4 method for class 'mrgmod' revar(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/revar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get model random effect variances and covariances — revar","text":"x model object. ... passed along.","code":""},{"path":"https://mrgsolve.org/docs/reference/revar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get model random effect variances and covariances — revar","text":"named list containing omega sigma matrices.","code":""},{"path":"https://mrgsolve.org/docs/reference/revar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get model random effect variances and covariances — revar","text":"","code":"mod <- mrgsolve::house() revar(mod) #> $omega #> $... #> [,1] [,2] [,3] [,4] #> ECL: 0 0 0 0 #> EVC: 0 0 0 0 #> EKA: 0 0 0 0 #> EKOUT: 0 0 0 0 #> #> #> $sigma #> $... #> [,1] #> EXPO: 0 #> #>"},{"path":"https://mrgsolve.org/docs/reference/scrape_and_call.html","id":null,"dir":"Reference","previous_headings":"","what":"Scrape options and pass to function — scrape_and_call","title":"Scrape options and pass to function — scrape_and_call","text":"Scrape options pass function","code":""},{"path":"https://mrgsolve.org/docs/reference/scrape_and_call.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scrape options and pass to function — scrape_and_call","text":"","code":"scrape_and_call(x, env, pass, ...)"},{"path":"https://mrgsolve.org/docs/reference/scrape_and_call.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scrape options and pass to function — scrape_and_call","text":"x data env parse environment pass function call ... arguments passed scrape_opts","code":""},{"path":"https://mrgsolve.org/docs/reference/scrape_and_call.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Scrape options and pass to function — scrape_and_call","text":"Attributes x also scraped merged options.","code":""},{"path":"https://mrgsolve.org/docs/reference/scrape_opts.html","id":null,"dir":"Reference","previous_headings":"","what":"Scrape options from a code block — scrape_opts","title":"Scrape options from a code block — scrape_opts","text":"Scrape options code block","code":""},{"path":"https://mrgsolve.org/docs/reference/scrape_opts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scrape options from a code block — scrape_opts","text":"","code":"scrape_opts( x, envir = list(), def = list(), all = TRUE, marker = \"=\", allow_multiple = FALSE, narrow = TRUE )"},{"path":"https://mrgsolve.org/docs/reference/scrape_opts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scrape options from a code block — scrape_opts","text":"x data envir environment $ENV def default values return options, even def marker assignment operator; used locate lines options allow_multiple TRUE, list replicate names reduced narrow logical; TRUE, get options lines starting >>","code":""},{"path":"https://mrgsolve.org/docs/reference/scrape_opts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scrape options from a code block — scrape_opts","text":"list elements x (data without options) named options specified block.","code":""},{"path":"https://mrgsolve.org/docs/reference/see.html","id":null,"dir":"Reference","previous_headings":"","what":"Print model code to the console — see","title":"Print model code to the console — see","text":"simple way display model code R console using model object. raw argument return model code character vector.","code":""},{"path":"https://mrgsolve.org/docs/reference/see.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print model code to the console — see","text":"","code":"see(x, ...) # S4 method for class 'mrgmod' see(x, raw = FALSE, ...)"},{"path":"https://mrgsolve.org/docs/reference/see.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print model code to the console — see","text":"x model object. ... used. raw return raw code.","code":""},{"path":"https://mrgsolve.org/docs/reference/see.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print model code to the console — see","text":"NULL returned invisibly raw FALSE; raw set TRUE, model code returned character vector.","code":""},{"path":"https://mrgsolve.org/docs/reference/show-cmt_list-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Show the compartment list — show,cmt_list-method","title":"Show the compartment list — show,cmt_list-method","text":"Show compartment list","code":""},{"path":"https://mrgsolve.org/docs/reference/show-cmt_list-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show the compartment list — show,cmt_list-method","text":"","code":"# S4 method for class 'cmt_list' show(object)"},{"path":"https://mrgsolve.org/docs/reference/show-cmt_list-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show the compartment list — show,cmt_list-method","text":"object object show","code":""},{"path":"https://mrgsolve.org/docs/reference/show-mrgmod-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Print model details — show,mrgmod-method","title":"Print model details — show,mrgmod-method","text":"Print model details","code":""},{"path":"https://mrgsolve.org/docs/reference/show-mrgmod-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print model details — show,mrgmod-method","text":"","code":"# S4 method for class 'mrgmod' show(object)"},{"path":"https://mrgsolve.org/docs/reference/show-mrgmod-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print model details — show,mrgmod-method","text":"object model object","code":""},{"path":"https://mrgsolve.org/docs/reference/show-parameter_list-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Show the parameter list — show,parameter_list-method","title":"Show the parameter list — show,parameter_list-method","text":"Show parameter list","code":""},{"path":"https://mrgsolve.org/docs/reference/show-parameter_list-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show the parameter list — show,parameter_list-method","text":"","code":"# S4 method for class 'parameter_list' show(object)"},{"path":"https://mrgsolve.org/docs/reference/show-parameter_list-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show the parameter list — show,parameter_list-method","text":"object object show","code":""},{"path":"https://mrgsolve.org/docs/reference/simargs.html","id":null,"dir":"Reference","previous_headings":"","what":"Access or clear arguments for calls to mrgsim() — simargs","title":"Access or clear arguments for calls to mrgsim() — simargs","text":"model object navigates pipeline prior simulation, arguments collected eventually passed mrgsim(). simargs() lets intercept possibly clear arguments.","code":""},{"path":"https://mrgsolve.org/docs/reference/simargs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access or clear arguments for calls to mrgsim() — simargs","text":"","code":"simargs(x, which = NULL, clear = FALSE, ...)"},{"path":"https://mrgsolve.org/docs/reference/simargs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access or clear arguments for calls to mrgsim() — simargs","text":"x model object. character length 1 naming single arg get. clear logical indicating whether clear args model object. ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/simargs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access or clear arguments for calls to mrgsim() — simargs","text":"clear TRUE, argument list cleared model object returned. Otherwise, argument list returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/simargs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access or clear arguments for calls to mrgsim() — simargs","text":"","code":"mod <- mrgsolve::house() mod %>% Req(CP, RESP) %>% carry_out(evid, WT, FLAG) %>% simargs() #> $carry_out #> [1] \"evid, WT, FLAG\" #>"},{"path":"https://mrgsolve.org/docs/reference/soloc.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the location of the model shared object — soloc","title":"Return the location of the model shared object — soloc","text":"also directory model built, value tempdir().","code":""},{"path":"https://mrgsolve.org/docs/reference/soloc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the location of the model shared object — soloc","text":"","code":"soloc(x, short = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/soloc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the location of the model shared object — soloc","text":"x model object. short logical; TRUE, solocs rendered short path name.","code":""},{"path":"https://mrgsolve.org/docs/reference/soloc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the location of the model shared object — soloc","text":"string containing full path model shared object.","code":""},{"path":"https://mrgsolve.org/docs/reference/soloc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the location of the model shared object — soloc","text":"","code":"mod <- mrgsolve::house() soloc(mod) #> [1] \"/private/var/folders/zv/v6tkdhrn1_bb1ndrc0c0j31w0000gp/T/Rtmp8iibY9/temp_libpath165cfb7dcafd/mrgsolve/libs\""},{"path":"https://mrgsolve.org/docs/reference/solversettings.html","id":null,"dir":"Reference","previous_headings":"","what":"Optional inputs for lsoda — solversettings","title":"Optional inputs for lsoda — solversettings","text":"settings differential equation solver (lsoda) can accessed via R interface. code listing taken directly lsoda source code.","code":""},{"path":"https://mrgsolve.org/docs/reference/solversettings.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Optional inputs for lsoda — solversettings","text":"following items can set hmax (HMAX ); decrease hmax want limit big step solver can take integrating one time next time. However aware smaller hmax result longer run times. hmin (HMIN ); fiddle unless know . ixpr (IXPR ) maxsteps (MXSTEP ); increase number solver long interval two integration times (e.g. observation records far apart). mxhnil (MXHNIL ); usually modify one atol - absolute solver tolerance; decrease number (e.g. 1E-10 1E-20 1E-50) value compartment can get extremely small; without extra (lower) tolerance, value can get low number can randomly become negative. However aware precision result longer run times. rtol - relative solver tolerances; decrease number want precise solution. However aware precision result longer run times.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the times at which the model will be evaluated — stime","title":"Get the times at which the model will be evaluated — stime","text":"Get times model evaluated","code":""},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the times at which the model will be evaluated — stime","text":"","code":"stime(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the times at which the model will be evaluated — stime","text":"x model object mrgsims object. ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the times at which the model will be evaluated — stime","text":"sorted vector unique simulation times time grid model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the times at which the model will be evaluated — stime","text":"Simulation times include sequence times created start, end, delta vector times found add. Making end negative (e.g. -1) omit start-end-delta sequence. Negative values discarded result.","code":""},{"path":"https://mrgsolve.org/docs/reference/stime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the times at which the model will be evaluated — stime","text":"","code":"## example(\"stime\", package=\"mrgsolve\") mod <- mrgsolve::house(end = 12, delta = 2, add = c(11,13,15)) stime(mod) #> [1] 0 2 4 6 8 10 11 12 13 15 update(mod, end = -1) %>% stime() #> [1] 11 13 15"},{"path":"https://mrgsolve.org/docs/reference/summary.mrgmod.html","id":null,"dir":"Reference","previous_headings":"","what":"Print summary of a mrgmod object — summary.mrgmod","title":"Print summary of a mrgmod object — summary.mrgmod","text":"Print summary mrgmod object","code":""},{"path":"https://mrgsolve.org/docs/reference/summary.mrgmod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print summary of a mrgmod object — summary.mrgmod","text":"","code":"# S3 method for class 'mrgmod' summary(object, ...)"},{"path":"https://mrgsolve.org/docs/reference/summary.mrgmod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print summary of a mrgmod object — summary.mrgmod","text":"object mrgmod object ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/tgrid.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a simtime object — tgrid","title":"Create a simtime object — tgrid","text":"simtime objects allow user specify simulation start end times, along simulation time step.","code":""},{"path":"https://mrgsolve.org/docs/reference/tgrid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a simtime object — tgrid","text":"","code":"tgrid( start = 0, end = 24, delta = 1, add = numeric(0), .offset = 0, .scale = 1, ... ) # S4 method for class 'tgrid' stime(x, ...) # S4 method for class 'tgrids' stime(x, ...) # S4 method for class 'numeric' stime(x, ...) # S4 method for class 'tgrid' show(object) # S4 method for class 'tgrids' show(object) # S4 method for class 'mrgmod' stime(x, ...)"},{"path":"https://mrgsolve.org/docs/reference/tgrid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a simtime object — tgrid","text":"start simulation start time. end simulation end time. delta simulation time step. add addition simulation times. .offset resulting set times adjusted amount. .scale resulting set times scaled factor. ... used. x tgrid object. object passed show","code":""},{"path":"https://mrgsolve.org/docs/reference/tgrid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a simtime object — tgrid","text":"","code":"peak <- tgrid(0, 6, 0.2) sparse <- tgrid(0, 24, 4) day1 <- c(peak, sparse) design <- c(day1, day1+72, day1+240) if (FALSE) { # \\dontrun{ mod <- mrgsolve::house() out <- mod %>% ev(amt=1000, ii=24, addl=10) %>% mrgsim(tgrid=design) plot(out, CP ~ time, type = 'b') } # }"},{"path":"https://mrgsolve.org/docs/reference/tgrid_ops.html","id":null,"dir":"Reference","previous_headings":"","what":"Operations with tgrid objects — c,tgrid-method","title":"Operations with tgrid objects — c,tgrid-method","text":"Operations tgrid objects","code":""},{"path":"https://mrgsolve.org/docs/reference/tgrid_ops.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Operations with tgrid objects — c,tgrid-method","text":"","code":"# S4 method for class 'tgrid' c(x, ..., recursive = FALSE) # S4 method for class 'tgrids' c(x, ..., recursive = FALSE) # S4 method for class 'tgrid,numeric' e1 + e2 # S4 method for class 'tgrid,numeric' e1 * e2 # S4 method for class 'tgrids,numeric' e1 + e2 # S4 method for class 'tgrids,numeric' e1 * e2"},{"path":"https://mrgsolve.org/docs/reference/tgrid_ops.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Operations with tgrid objects — c,tgrid-method","text":"x tgrid object. ... additional tgrid objects. recursive used. e1 tgrid tgrids object e2 numeric value","code":""},{"path":"https://mrgsolve.org/docs/reference/touch_funs.html","id":null,"dir":"Reference","previous_headings":"","what":"Get inits from compiled function — touch_funs","title":"Get inits from compiled function — touch_funs","text":"function usually internal use.","code":""},{"path":"https://mrgsolve.org/docs/reference/touch_funs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get inits from compiled function — touch_funs","text":"","code":"touch_funs(x, keep_pointers = TRUE)"},{"path":"https://mrgsolve.org/docs/reference/touch_funs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get inits from compiled function — touch_funs","text":"x mrgmod model object keep_pointers function pointers returned?","code":""},{"path":"https://mrgsolve.org/docs/reference/tscale.html","id":null,"dir":"Reference","previous_headings":"","what":"Re-scale time in the simulated output — tscale","title":"Re-scale time in the simulated output — tscale","text":"Re-scale time simulated output","code":""},{"path":"https://mrgsolve.org/docs/reference/tscale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Re-scale time in the simulated output — tscale","text":"","code":"tscale(x, value = 1, ...)"},{"path":"https://mrgsolve.org/docs/reference/tscale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Re-scale time in the simulated output — tscale","text":"x model object. value value time scaled. ... used.","code":""},{"path":"https://mrgsolve.org/docs/reference/tscale.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Re-scale time in the simulated output — tscale","text":"also tscale argument mrgsim() can set accomplish thing call tscale pipeline.","code":""},{"path":"https://mrgsolve.org/docs/reference/tscale.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Re-scale time in the simulated output — tscale","text":"","code":"# The model is in hours: mod <- mrgsolve::house() # The output is in days: mod %>% tscale(1/24) %>% mrgsim() #> Model: housemodel #> Dim: 481 x 7 #> Time: 0 to 5 #> ID: 1 #> ID time GUT CENT RESP DV CP #> 1: 1 0.00000 0 0 50 0 0 #> 2: 1 0.01042 0 0 50 0 0 #> 3: 1 0.02083 0 0 50 0 0 #> 4: 1 0.03125 0 0 50 0 0 #> 5: 1 0.04167 0 0 50 0 0 #> 6: 1 0.05208 0 0 50 0 0 #> 7: 1 0.06250 0 0 50 0 0 #> 8: 1 0.07292 0 0 50 0 0"},{"path":"https://mrgsolve.org/docs/reference/update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update the model object — update","title":"Update the model object — update","text":"model object created, update various attributes.","code":""},{"path":"https://mrgsolve.org/docs/reference/update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update the model object — update","text":"","code":"# S4 method for class 'mrgmod' update(object, ..., merge = TRUE, open = FALSE, data = NULL, strict = TRUE) # S4 method for class 'omegalist' update(object, y, ...) # S4 method for class 'sigmalist' update(object, y, ...) # S4 method for class 'parameter_list' update(object, .y, ...)"},{"path":"https://mrgsolve.org/docs/reference/update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update the model object — update","text":"object model object. ... named items update. merge logical indicating merge (rather replace) new existing attributes. open logical; used merge TRUE parameter list initial conditions list updated; FALSE, new items added; TRUE, parameter list may expand. data list items update; list combined items passed via .... strict TRUE, warning issued attempt update non-existent item. y another object involved update .y data update","code":""},{"path":"https://mrgsolve.org/docs/reference/update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update the model object — update","text":"updated model object returned.","code":""},{"path":"https://mrgsolve.org/docs/reference/update.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update the model object — update","text":"Slots can updated: verbose debug preclean mindt digits atol - absolute solver tolerance; see solversettings rtol - relative solver tolerance; see solversettings ss_rtol - relative tolerance finding steady state ss_atol - absolute tolerance finding steady state ixpr - see IXPR solversettings mxhnil - see MXHNIL solversettings hmin - see HMIN solversettings hmax - see HMAX solversettings maxsteps - see MXSTEP solversettings start, end, delta, add tscale request param init omega sigma outvars","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update the model object — update","text":"","code":"if (FALSE) { # \\dontrun{ mod <- house() mod <- update(mod, end = 120, delta = 4, param = list(CL = 19.1)) } # }"},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":null,"dir":"Reference","previous_headings":"","what":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"Call use_custom_tol() use custom relative absolute tolerances model; call use_scalar_tol() revert traditional configuration single rtol atol applied compartments.","code":""},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"","code":"use_custom_tol(x) use_scalar_tol(x)"},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"x model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"updated model object.","code":""},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"customized tolerances initialized yet, , assigning current rtol atol every compartment. default values can updated using custom_rtol(), custom_atol(), custom_tol().","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/use_custom_tol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set up a model object to use either scalar or custom tolerances — use_custom_tol","text":"","code":"mod <- house() mod <- use_custom_tol(mod) mod #> #> #> -------------- source: housemodel.cpp -------------- #> #> project: /private/var/fol...solve/project #> shared object: mrgsolve #> #> time: start: 0 end: 120 delta: 0.25 #> add: <none> #> compartments: GUT CENT RESP [3] #> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC #> KIN KOUT IC50 WT SEX [14] #> captures: DV CP [2] #> omega: 4x4 #> sigma: 1x1 #> #> solver: rtol: -- atol: -- itol: 4 (custom) #> ------------------------------------------------------ mod <- use_scalar_tol(mod) mod #> #> #> -------------- source: housemodel.cpp -------------- #> #> project: /private/var/fol...solve/project #> shared object: mrgsolve #> #> time: start: 0 end: 120 delta: 0.25 #> add: <none> #> compartments: GUT CENT RESP [3] #> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC #> KIN KOUT IC50 WT SEX [14] #> captures: DV CP [2] #> omega: 4x4 #> sigma: 1x1 #> #> solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar) #> ------------------------------------------------------"},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate and prepare data sets for simulation — valid_data_set","title":"Validate and prepare data sets for simulation — valid_data_set","text":"function called mrgsim() friends check prepare input data sets simulation. Users may also call function pre-validate data data set used repeated simulation.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate and prepare data sets for simulation — valid_data_set","text":"","code":"valid_data_set(x, m = NULL, verbose = FALSE, quiet = FALSE) valid_data_set.matrix(x, verbose = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate and prepare data sets for simulation — valid_data_set","text":"x data.frame matrix. m model object. verbose logical. quiet TRUE, messages suppressed.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate and prepare data sets for simulation — valid_data_set","text":"matrix non-numeric columns dropped; x data.frame character cmt column comprised valid compartment names m model object, cmt column converted corresponding compartment number.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate and prepare data sets for simulation — valid_data_set","text":"error issued non-numeric data found columns sharing names model parameters non-numeric data found reserved data items related dosing (see mrgsolve:::GLOBALS$CARRY_TRAN) column found \"internally classed\", including columns inherit integer64 (see .object())","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/valid_data_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate and prepare data sets for simulation — valid_data_set","text":"","code":"mod <- mrgsolve::house() data(exTheoph) d <- valid_data_set(exTheoph, mod)"},{"path":"https://mrgsolve.org/docs/reference/valid_idata_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate and prepare idata data sets for simulation — valid_idata_set","title":"Validate and prepare idata data sets for simulation — valid_idata_set","text":"function called mrgsim() friends check prepare input data sets simulation. Users may also call function pre-validate data data set used repeated simulation.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_idata_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate and prepare idata data sets for simulation — valid_idata_set","text":"","code":"valid_idata_set(x, m, verbose = FALSE, quiet = FALSE)"},{"path":"https://mrgsolve.org/docs/reference/valid_idata_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate and prepare idata data sets for simulation — valid_idata_set","text":"x data.frame matrix. m model object. verbose logical. quiet TRUE, messages suppressed.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_idata_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate and prepare idata data sets for simulation — valid_idata_set","text":"numeric matrix class valid_idata_set.","code":""},{"path":"https://mrgsolve.org/docs/reference/valid_idata_set.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate and prepare idata data sets for simulation — valid_idata_set","text":"error issued non-numeric data found columns sharing names model parameters column found internally classed, including columns inherit integer64 (see .object())","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/wf_sweep.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate a sequence of parameters — wf_sweep","title":"Simulate a sequence of parameters — wf_sweep","text":"function experimental may change go away time without notice.","code":""},{"path":"https://mrgsolve.org/docs/reference/wf_sweep.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate a sequence of parameters — wf_sweep","text":"","code":"wf_sweep(mod, ..., n = 10, cv = 30, nsd = 2)"},{"path":"https://mrgsolve.org/docs/reference/wf_sweep.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate a sequence of parameters — wf_sweep","text":"mod model object ... unquoted parameter names n number values simulate cv coefficient variation; used determine minimum maximum values sweep nsd number standard deviations sweep","code":""},{"path":"https://mrgsolve.org/docs/reference/wf_sweep.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate a sequence of parameters — wf_sweep","text":"mrgsims object character columns named .name indicating parameter name .value indicating sweep value.","code":""},{"path":"https://mrgsolve.org/docs/reference/wf_sweep.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulate a sequence of parameters — wf_sweep","text":"","code":"mod <- mrgsolve::house() %>% zero_re() mod %>% ev(amt = 100) %>% wf_sweep(CL, VC) %>% plot(CP~time|.name)"},{"path":"https://mrgsolve.org/docs/reference/within.html","id":null,"dir":"Reference","previous_headings":"","what":"Update parameters, initials, and settings within a model object — within","title":"Update parameters, initials, and settings within a model object — within","text":"main use case using within rather update param init want update new value calculated existing value. See example details","code":""},{"path":"https://mrgsolve.org/docs/reference/within.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update parameters, initials, and settings within a model object — within","text":"","code":"# S3 method for class 'mrgmod' within(data, expr, ...)"},{"path":"https://mrgsolve.org/docs/reference/within.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update parameters, initials, and settings within a model object — within","text":"data object class mrgmod expr expressions evaluated environment containing various model object components, including parameters, initial conditions, others (see details) ... used","code":""},{"path":"https://mrgsolve.org/docs/reference/within.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update parameters, initials, and settings within a model object — within","text":"model object slots can updated: start, end, delta, add, rtol, atol, hmax, maxsteps. include convenience, expect time get updated update method.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/reference/within.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update parameters, initials, and settings within a model object — within","text":"","code":"mod <- mrgsolve::house() mod2 <- within(mod, {CL <- CL * 1.5}) mod$CL #> [1] 1 mod2$CL #> [1] 1.5"},{"path":"https://mrgsolve.org/docs/reference/zchain.html","id":null,"dir":"Reference","previous_headings":"","what":"Forward pipe — %>%","title":"Forward pipe — %>%","text":"Forward pipe","code":""},{"path":"https://mrgsolve.org/docs/reference/zero_re.html","id":null,"dir":"Reference","previous_headings":"","what":"Zero out random effects in a model object — zero_re","title":"Zero out random effects in a model object — zero_re","text":"Sets elements OMEGA SIGMA matrix zero.","code":""},{"path":"https://mrgsolve.org/docs/reference/zero_re.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Zero out random effects in a model object — zero_re","text":"","code":"zero_re(.x, ...) # S4 method for class 'mrgmod' zero_re(.x, ...)"},{"path":"https://mrgsolve.org/docs/reference/zero_re.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Zero out random effects in a model object — zero_re","text":".x model object. ... matrix zero ; pass omega just zero omega, sigma just zero sigma; passing nothing zero .","code":""},{"path":"https://mrgsolve.org/docs/reference/zero_re.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Zero out random effects in a model object — zero_re","text":"updated object elements OMEGA /SIGMA set zero.","code":""},{"path":"https://mrgsolve.org/docs/reference/zero_re.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Zero out random effects in a model object — zero_re","text":"","code":"mod <- house() revar(mod) #> $omega #> $... #> [,1] [,2] [,3] [,4] #> ECL: 0 0 0 0 #> EVC: 0 0 0 0 #> EKA: 0 0 0 0 #> EKOUT: 0 0 0 0 #> #> #> $sigma #> $... #> [,1] #> EXPO: 0 #> #> mod <- zero_re(mod) revar(mod) #> $omega #> $... #> [,1] [,2] [,3] [,4] #> ECL: 0 0 0 0 #> EVC: 0 0 0 0 #> EKA: 0 0 0 0 #> EKOUT: 0 0 0 0 #> #> #> $sigma #> $... #> [,1] #> EXPO: 0 #> #> if (FALSE) { # \\dontrun{ mod <- modlib(\"popex\", compile = FALSE) mod <- zero_re(mod, omega) revar(mod) } # }"},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-161","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.6.1","title":"mrgsolve 1.6.1","text":"CRAN release: 2025-08-22 Internal refactor self.mevent() self.mtime() send event objects back mrgsolve requested object time past; preserves previous functionality respecting change 1.6.0 generates error events (event sequences) happen begin past (#1297).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-160","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.6.0","title":"mrgsolve 1.6.0","text":"evt::tgrid() added evtools plugin, allowing users insert internal-(non-output) records simulation monitoring system regular grid times (#1291). evt::evid() added evtools plugin allowing users reset event ID attribute event objects created inside model (#1291). EVID behavior changed event IDs greater equal 100 trigger reset ODE solver, functioning like observation records EVID=0; EVID < 100, discontinuity continue happen ODE solver reset (#1291). Event objects created model (typically evtools plugin) now trigger error event event sequence starts current simulation time; events previously ignored silently (#1291). Absolute (atol) relative (rtol) tolerances can now customized compartment ODE-based model (#1264) Usecustom_rtol(), custom_atol(), custom_tol() set tolerances compartment--compartment basis. Use reset_rtol(), reset_atol(), reset_tol() reset custom tolerances. Use use_custom_tol() use_scalar_tol() toggle model use either customized (vector) values scalar values. Use get_tol() get_tol_list() extract custom scalar tolerance values. model print method updated reflect whether model currently set use scalar customized (vector) values.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-6-0","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.6.0","text":"Fixed bug incorrectly spelled block names inadvertently aliased resulting misleading error message (#1294). Fixed bug OMEGA SIGMA matrices imported model via multiple $NMEXT $NMXML blocks matrix one block ignored (#1276).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-153","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.5.3","title":"mrgsolve 1.5.3","text":"D_CMT, ALAG_CMT, simeta() now available use $TABLE ($ERROR), $EVENT, $PRED code blocks (#1290). Added END_OF_INFUSION syntax, true internal record stops infusion (#1288). mwrite_yaml() mwrite_cpp() now render block names upper case, even blocks coded lower case original model file (#1282). creating evt::regimen object (via evtools plugin), default start time now time object created; change, default time always 0 (#1266). Added methods evt::regimen objects (via evtools plugin) name time_next(); either gets sets time next dose regimen (#1266).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-5-3","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.5.3","text":"Fixed issue time values simulated output data frame small amount, due issues floating point mathematical operations (#1287). Fixed problem writing model file mwrite_yaml() mwrite_cpp() lower case block naming used (#1282). Fixed bug invalid item passed $SET block caused error reading / building model (#1271). Fixed bug mrgsolve matching NONMEM behavior EVID=4 record included data set SS=1; mrgsolve now match NONMEM behavior case, output identical EVID=1 SS=1 (#1262).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-152","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.5.2","title":"mrgsolve 1.5.2","text":"CRAN release: 2024-10-18 Add $EVENT block writing code related dosing events implemented model code rather data set (#1230). Add evt::reset() evt::reset(self) functions evtools plugin; reset compartments model; overloaded functions also provided reset dose bolus infusion (#1222). Completed dosing functionality evtools plugin; use evt::addl() schedule additional doses evt::ev object; use evt::ii() set dosing interval; use evt::ss() advance pharmacokinetic system steady state just prior dosing; evt::cmt() sets compartment number; evt::amt() sets dose amount; evt::rate() sets infusion rate; see user guide specific signatures available (#1227). Add evtools model modlib(), illustrating implement dosing regimens inside model different ways (#1230). Added comprehensive checking duplicate blocks model file; duplicate blocks always handled allowed; error message always issued duplicates allowed (#1238). Code audit $ODE ($DES) code, looking equation every model compartment refactored use common approach traditional models models written nm-vars plugin; regardless approach, user warned mrgsolve detect code relevant every model compartment; audit system can bypassed including @!audit block option $ODE (#1235). autodec plugin lightly refactored avoid false positive detection variables declared double; plans place narrow scope detected declaration future releases (#1234). R help files (.Rd) reviewed revised consistency formatting (#1246).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-151","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.5.1","title":"mrgsolve 1.5.1","text":"CRAN release: 2024-07-26 Fixed yaml_to_cpp() example code prevent saving file working directory (#1220).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-150","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.5.0","title":"mrgsolve 1.5.0","text":"New functions mwrite_yaml() mwrite_cpp() can write model object back file, accounting updates since model read native mrgsolve format using mread() (#1190, #1213). New function mread_yaml() reading back models written mwrite_yaml() (#1190, #1213). New functions evtools plugin: evt::replace() works like evt::bolus(), replace amount given compartment rather add (#1203). nm-vars plugin now exposes DEXP(), LOG10(), COS() SIN() use mrgsolve C++ code blocks (#1199). error now generated KA equal CL/VC simulating one-compartment model analytical solution invoked $PKMODEL (#1179, #1197).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-5-0","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.5.0","text":"bug fixed certain data frame inputs passed as_data_set() (#1115, #1196).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-142","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.4.2","title":"mrgsolve 1.4.2","text":"error now issued simulation time simulation data sets (data idata) contain non-numeric data columns sharing names parameters; non-numeric data columns certain reserved names (like AMT, RATE, II, ADDL, etc.) also result error (#1193). Internal refactoring improve performance simulating infusions doses lag times doses coded explicitly data set (#1186, #1187).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-141","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.4.1","title":"mrgsolve 1.4.1","text":"CRAN release: 2024-02-13 Fix bug evt::regimen.ii(double) timing next dose expected (#1170).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-140","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.4.0","title":"mrgsolve 1.4.0","text":"CRAN release: 2024-02-08 evtools new plugin providing API dynamic dosing within model; functions classes evt namespace (#1149). regimen new class located evt namespace via evtools plugin; regimen objects can execute doses regular regimen (#1156). mread() mcode() longer print message required waiting period model recompile (#1145). ev_rep() output rownames cleaned returning (#1158). C++ model code blocks (GLOBAL, PREAMBLE, MAIN/PK, ODE/DES, TABLE/ERROR) now checked <object>.<attribute> syntax; found, symbols sides dot become reserved words loading compiling model; specifically, error generated either side dot (<object> <attribute>) found parameter names, compartment names, ETA labels, EPS labels (#1159). ETA values always simulated OMEGA, even user requests get scraped data idata via etasrc argument mrgsim(); ensures EPS reproducible model runs etasrc = \"omega\" (default, ETA simulated) , example, etaasrc = \"data.\" (scrape ETA data set) (#1163).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-4-0","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.4.0","text":"Fixed bug modeled doses scheduled happen now ignored time attribute set value prior current simulation time (#1152). Fixed bug doses computed using argument ev() (#1154).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-130","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.3.0","title":"mrgsolve 1.3.0","text":"CRAN release: 2023-12-04 evdata object modeled events now contains check_unique member; set false, event processed without checking matching record modeled event log (#1119). amt attribute evdata modeled event objects now considered looking duplicate records modeled event log (#1119).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-3-0","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.3.0","text":"Fixed bug multiple lagged doses given time different bioavailability given bioavailability last dosing record (#1129, #1130). Fixed bug modeled infusions given now never turned (#1131). Fixed bug self object (type: databox) passed functions written header files included $INCLUDE; header files now included immediately preceding user code written $GLOBAL (#1125, #1126). Fixed bug modeled event log getting reset simulating first individual; resulted events getting executed subsequent individuals matching events executed first individual; affects modeled events , events coming data set (#1117, #1118). Fixed bug detecting compartments receiving doses (#1112, #1113).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-120","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.2.0","title":"mrgsolve 1.2.0","text":"Data set records time within individual receive different EPS draws; change previous behavior records time received value EPS (#1110).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-111","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.1.1","title":"mrgsolve 1.1.1","text":"CRAN release: 2023-08-16 Remove .x matlist documentation object per new NOTE output rdevel (#1103, #1104).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-110","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.1.0","title":"mrgsolve 1.1.0","text":"Add new functionality assessing consistency names input data set parameter names (#1078). New function check_data_names() executes check. New model specification block $INPUT marking parameters “inputs” expecting present data check_data_names() called. New $PARAM block attributes @input @tag adding tags parameters checked check_data_names() called. New function param_tags() list parameters tags given model. Now checking TIME time assessing upper / lower case name consistency input data sets (#1099). ETAs can now passed problem via idata passing eta_src either idata idata.mrgsim() (#1092). Internal refactor mechanics checking user interrupt simulation (#1088). Minor re-factor mrgsim_nid() documentation update line original intent; meaningful change functionality (#1086). parameter_list objects can now passed param() (#1076). ev_rx() syntax gains & operator allowing specification multiple events single time (#1072). Kyle Meyer added contributor (#1096). modlib() model 1005 re-coded reflect “traditional” model specification syntax (#1069). model object update() method issue warning unrecognized arguments passed (#1068).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-1-0","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.1.0","text":"Fixed bug ETA first column data recognized using eta_src = \"data\" eta_src = \"data.\" (#1095).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-109","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.9","title":"mrgsolve 1.0.9","text":"CRAN release: 2023-03-10 Fix signatures compiled.mrgmod() as_tibble.mrgsims() based new R-devel check findings (#1065).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-108","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.8","title":"mrgsolve 1.0.8","text":"CRAN release: 2023-03-04 SIGMA() new model macro allows users access -diagonal elements SIGMA model (e.g. SIGMA(2) $ERROR) (#1051, #1052). mrgsim() mrgsim_q() gain etasrc argument, allowing ETAs either simulated OMEGA (new default previously behavior) taken input data set (new option), similar way parameters can scraped data set (#1037). @etas new option use $CAPTURE block let users name ETAs captured simulated output; example, use @etas 1:last capture model ETAs simulated output (#1055). Drop CXX_STD statement Makevars file DESCRIPTION consistent current changes R-devel; mrgsolve continues require compiler capable implementing C++11 standard, selected automatically R (#1060). mrgsolve now depends R >= 3.6.2 (#1060).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-0-8","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.0.8","text":"Fix bug path argument used $NMXML $NMEXT blocks; bug introduced @cppstem feature version 1.0.7 (#1046, #1048). Fix bug mread_cache() project directory wasn’t getting rendered properly passing complete path model specification file (#1056).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-107","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.7","title":"mrgsolve 1.0.7","text":"$NMXML $NMEXT now accept run argument set \"@cppstem\" (.erun = \"@cppstem\"); case, stem NONMEM run assumed stem mrgsolve model file (#1025). Missing values (NA) input data sets replaced 0 following columns: AMT, CMT, EVID, II, ADDL, RATE, SS well lower case counterparts (#1030). Refactored include order building model; internal update expected visible user (#1038).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-0-7","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.0.7","text":"Fix bug generating certain model definitions using nm-vars plugin; bug resulted warning pre-processor affect function model (#1039).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-106","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.6","title":"mrgsolve 1.0.6","text":"CRAN release: 2022-08-29","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-0-6","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.0.6","text":"Fix bug TOUCH_FUNS parameter compartment lists getting generated properly mrgsolve loaded; bug detected fixed prior upload CRAN MPN (#1013).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-105","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.5","title":"mrgsolve 1.0.5","text":"Changed behavior dosing records EVID = 4 SS != 0 match done NONMEM: system advanced steady-state reset; behavior prior 1.0.5 release advance steady-state reset (#1011). column input data set class attribute now dropped addition non-numeric columns; includes columns integer64 can present data frames derived data.table::fread() .csv readers (#1008). $MAIN $TABLE blocks longer get called actual dose administration records lag times; change time dose calculations calculations happening blocks actual administration taking place (#992). Code update parameter list re-factored much efficient (#978).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-1-0-5","dir":"Changelog","previous_headings":"","what":"Bugs Fixed","title":"mrgsolve 1.0.5","text":"Fix bug apparent dosing events additional doses lag times getting scheduled (records actual administration); doesn’t change simulated output change time dose calculation (#992). Fix bug special nm-vars variables getting recognized valid capture items dynamic capture (#987). Fix bug updating parameter list data frame included non-numeric columns parameters (#978).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-104","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.4","title":"mrgsolve 1.0.4","text":"CRAN release: 2022-05-16 Fix bug as_data_frame() properly working leading event object evd type (#948, #955). Add uctran() convert nmtran data names upper case (#955). lctran() uctran() generic work data.frame event (ev) objects (#949, #955). Fix bug data records EVID = 3 getting shifted time ALAG (#964, #969). Small negative eigenvalues OMEGA SIGMA set zero multivariate normal simulation ETA EPS, following pattern seen MASS::mvrnorm() (#956, #957). Fixed bug template parameters (T) getting modified nm-vars plugin used conjunction mrgx plugin (#965, #968).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-103","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.3","title":"mrgsolve 1.0.3","text":"CRAN release: 2022-03-21 Removed assert() statement LSODA code found CRAN check (#943).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-102","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.2","title":"mrgsolve 1.0.2","text":"CRAN release: 2022-03-17 Test class using inherits() class() CRAN check (#943).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-101","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.1","title":"mrgsolve 1.0.1","text":"Add LOG(), EXP(), SQRT() macros nm-vars plugin invoked (#931, #936). Use evd() create event object renders nmtran names upper case (e.g. TIME rather time) (#935, #919). Fixed bug rate getting set modeled events (#934). Fixed bug self.stop_id() self.stop_id_cf() reversed behavior documented (#927, #928). Refactored EVID=3 behavior leave NEWIND -(#934).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-100","dir":"Changelog","previous_headings":"","what":"mrgsolve 1.0.0","title":"mrgsolve 1.0.0","text":"CRAN release: 2022-01-20 New model syntax: THETA(n) interpreted THETAn model code; THETA now reserved word (#837, #891, #892). New functions collapse_omega(), collapse_sigma() collapse_matrix() added help reshape OMEGA SIGMA matrix objects multiple blocks (#897, #900). New plugin nm-vars implements NONMEM-like syntax referring compartments, differential equations, bioavailability factor, infusion duration rate, lag time (#904, #891). New plugin autodec find user-defined variables model code automatically declare type double (#905, #893). Use ii spacer setting -dose interval putting event objects sequence (c.f. wait) (#906, #901). Start deprecatingsimeta(n) simeps(n), calls simeta() simeps() integer argument thus limiting update just single ETA(n) EPS(n); use model code generate warning loading model contains n integer value (#908, #909).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0112","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.11.2","title":"mrgsolve 0.11.2","text":"pk2iv, change scaling volume CENT V2 (incorrect) V1 (#831, #832, #833) Fix bug collating multiple $OMEGA $SIGMA matrices parsing model (#863) Refactor debugging information processed using recover argument mread() (#853) Fix typo documentation as_cmat(); -diagonals assumed contain correlations (#856) Wrote .data.frame.matrix() function Rcpp; simulation results return C++ simulation code data frame (#857) Fix bug dynamic capture (via mread()) allowed variables declared $GLOBAL (#868)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0111","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.11.1","title":"mrgsolve 0.11.1","text":"CRAN release: 2021-05-10 mrgsim() now periodically check user interrupt signal long-running simulations can stopped using Esc / Control-C; check interval can modified interrupt argument mrgsim(), applications, shouldn’t need changed (#823) mrgsim() issue warning duplicate columns found simulated output rename duplicates using make.names(); thanks @FelicienLL report (#827, #828) Users can now turn compartments active infusions running; previously error (#822)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0110","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.11.0","title":"mrgsolve 0.11.0","text":"CRAN release: 2021-03-28 absolute paths nonmem output files (root.xml root.ext) now saved model object nonmem results imported via $NMEXT $NMXML; paths accessible coercing model object .list() looking nm_import item (#802) Add Tim Waterhouse contributor (#809) Add root argument $NMEXT $NMXML nonmem output files located relative working directory (default, previous behavior) directory cppfile stored; cppfile eventually replace working default (#803) Models based $PRED now respect obsonly option (#811)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0109","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.9","title":"mrgsolve 0.10.9","text":"Dosing compartment time dose turns compartment back regardless whether bioavailability zero non-zero (bug fix compartment turned bioavailability zero). (#800) simeta() simeps() now accept (optional) integer argument limit re-simulation single ETA EPS values (#789) .list(mod) output now includes data frame C++ variables pre-processor definitions cpp_variables slot. (#780) $PARAM, $THETA, $CMT, $INIT, $OMEGA $SIGMA blocks include directives @object @as_object block contents can specified programmatically. @object names object coded $ENV @as_object indicates block contains code realize object. See ?BLOCK_PARSE help topic information works. (#783) $NMEXT now lets user select multiple tables scraping parameter estimates. (#782)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0108","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.8","title":"mrgsolve 0.10.8","text":"Allow simulation compartmental models negative times #778 Enable dynamic capture pre-processor directives compile time #776 Fix error message requesting invalid items dynamic capture #776","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0107","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.7","title":"mrgsolve 0.10.7","text":"CRAN release: 2020-12-09 Stop testing test_equal using lattice","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0106","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.6","title":"mrgsolve 0.10.6","text":"Fix url endings check r-devel Adjust test comparing lattice plots based change r-devel; passing check.environments now","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0105","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.5","title":"mrgsolve 0.10.5","text":"Suppress warnings non-numeric columns dropped columns relevant simulation (#709) Add $ERROR alias $TABLE model file (#710) Fix bug warning messages steady-state finding referenced rtol atol rather ss_rtol ss_atol (#703) Fix annotation parsing bug description included semi-colon (#696) loadso issues proper error model dll doesn’t exist (#724) Try loading model loadso model isn’t loaded time simulation (#725) Throw error addl ss negative (#733) Internal refactoring hard solver reset parameters copied data change (#744) Add tad plugin calculate time dose specific compartment (#702) Internal refactor carry_out respect default nocb behavior (#759; see also #744) Throw error matlist labels duplicated (#730) Add capture argument mread add $CAPTURE compiling model (#704)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0103","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.3","title":"mrgsolve 0.10.3","text":"simulation time grid adjusted rendering grid result times (length 0 vector times); breaking change previous behavior time grid resolved 0 observations found. breaking change, old behavior almost always wrong desired output series non-observation records (#640) Added 1005 model Added recover mechanism join items input data sets output (#646) Allow simulation empty time grid; potentially break existing code; common (#648) Add collapse_omega collapse_sigma arguments [ set ] block (#651) Add separate tolerances (ss_rtol ss_atol) control advance steady state (#652) Fix bug realize_addl addl zero ii (#653) Fix bug system reset EVID 4 infusion dose (#683) NMXML now take vector tname add custom names imported THETAs (#687) Add NMEXT block works similar (identical) NMXML, reads run.ext file (#509)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0101","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.1","title":"mrgsolve 0.10.1","text":"CRAN release: 2020-02-21 Add select_sims method selecting columns mrgsims object (#585) Fix bug system improperly advanced steady state dosing record lag time system failed reach steady state (#596) Add better compartment level control advancing system steady state (#598) Allow user set CXX_FLAGS $ENV block (#603) Add N_CMT plugin number (index) every compartment available name (e.g. N_CENT number index central compartment) (#606) Fix bug blocks() failed model defined Rmd file (#608) Call ODE block every time system tries advance variables calculated ODE properly calculated output (#613) Add within method mrgmod (#616) Access initial compartment values model object items $ operator mrgmod (#620) Add plot method signature c(\"mrgsims\", \"character\"); pass character vector outputs plot (#630) house model, previously accessible mrgsolve:::house() now exported function (#625) Exporting outvars function extract names current output variables model object Now importing lifecycle glue packages","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0100","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.10.0","title":"mrgsolve 0.10.0","text":"CRAN release: 2019-10-15 Remove qsim associated functions Export new function / workflow qsim simpler, quicker simulation routine (#490) tad calculation (called mrgsim() variants) recognizes evid 4 addition evid 1 (#502) Fix bug $NMXML fails nm namespace found xml file (#510) Arguments ev constructor now evaluated; example, ev(amt = 100, rate = amt/2) (#512) Add $ [[ operators event objects (#513) Recalculate rate (tinf), addl (total ) upon mutate (#513) Standardize column order event objects (#513) mrgsim_e mrgsim_ei try accept data frame validated data sets Drop ODEPACK solver implement lsoda C++ (#504) Add C++11 system requirement Add constant infusion steady state (#249) Add outvars argument update method; replace Req Add two arguments mrgsim: ss_n ss_fixed control advance steady state; warning issued ss_fixed FALSE system doesn’t reach steady state within ss_n iterations (#533) error issued first argument mrgsim variants model object (#547) Argument xpath added nmxml() handle cases nm namespace found xml file (#510) informative error messages included processing input data sets (#534) problem ODE system advanced, informative error messages lsoda mrgsolve issued along value istate (#457) Add ability ss=1 dosing record bioavailability zero (#497) Error messages issued following found input event object construction: rate/tinf, addl/total, addl/(#513) tinf used create event object, item retained used set infusion rate (along dose) removed; error try set rate tinf event object (#513) Fix bug related column identification expand_observations (#563) Add record position argument expand_observations allow control record sort order (#565)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-092","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.9.2","title":"mrgsolve 0.9.2","text":"CRAN release: 2019-07-13 Fix bug system advanced next time advancing steady state dosing record ss=1 observation record time preceding dosing record (#484) Add AMT CMT macros self.amt self.cmt, respectively (#354) Re-organize DLSODA code avoid CRAN LTO warning","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-091","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.9.1","title":"mrgsolve 0.9.1","text":"CRAN release: 2019-06-14 Fix bug TAD plugin time last dose never moved default Add option mrgsolve_q call standard mrgsolve simulation rather streamlined function; decision made whether streamlined function retained Fix bug model parser commented lines () leading spaces handled properly (#450) Objects class valid_data_set now retain matrix attribute (#448) Block names now coerced upper case letters Change default simcall 0 mrgsim_q Add recover argument mread Add @as_object option following blocks: PARAM, INIT, CMT, OMEGA, SIGMA; experimental Allow multiple ODE blocks Add mtime function self object simpler mtime implementation Add @param block option ODE blocks; use comma-separated name=value pairs add parameter list within ODE Remove BLAS code embedded ODEPACK fortran files per CRAN request","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-090","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.9.0","title":"mrgsolve 0.9.0","text":"CRAN release: 2019-01-23 Added logy logbr arguments plot.mrgsims results y-axis outputs can easily plotted log scale release","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-functions-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"New functions","title":"mrgsolve 0.8.12.9000","text":"Added numerics_only function drop non-numeric columns input data set optionally converting logical columns integer Added ev_rx function write dosing interventions notation similar prescription ‘sig’","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"New features","title":"mrgsolve 0.8.12.9000","text":"Added $PRED block models don’t utilize compartments Added pred1 internal model library (modlib()) Added mrgsim_q function simulation model object quicker turnaround time mread take soloc project arguments options() mrgsolve.soloc mrgsolve.project, respectively Added output argument mrgsim e.g. data.frame can returned, without creating usual mrgsims object directory name passed soloc argument mread (mcode cache versions ) created doesn’t exist Added pk2iv model convenience option Added tinf argument ev() constructor function","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-behavior-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"New behavior","title":"mrgsolve 0.8.12.9000","text":"time/TIME longer required data set $PRED use cmt/CMT longer required data set; default value 0 assigned case missing error continue generated dosing invalid compartment (0 always invalid index dosing compartment) error generated missing values (NA) detected input data set following names: ID, time/TIME, column shares name item parameter list index argument added $NMXML block allow results selection multiple estimation blocks used. new default use last result. modlib now able function wrapper mread models model library , example, modlib(\"pk1\") equivalent mread(\"pk1\", modlib()).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.8.12.9000","text":"Fixed bug related record sort order (#406)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"deprecated-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"mrgsolve 0.8.12.9000","text":"drop.re drop_re; use zero_re instead","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"breaking-changes-0-8-12-9000","dir":"Changelog","previous_headings":"","what":"Breaking changes","title":"mrgsolve 0.8.12.9000","text":"undocumented function called report previously available use model code. function moved namespace now available mrg::report. feature continues undocumented.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0812","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.12","title":"mrgsolve 0.8.12","text":"CRAN release: 2018-04-27 Minor changes namespace CRAN","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0811","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.11","title":"mrgsolve 0.8.11","text":"CRAN release: 2018-04-26 Internal release Removed function s replaced s_; problem created mrgsolve rather ggplot2, calls mgcv::s via geom_smooth certain circumstances","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109015","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9015","title":"mrgsolve 0.8.10.9015","text":"Re-configured list data coming .list.mrgmod names match names pass update.mrgmod; also added items updatable slots model object exported calling .list (#354)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109014","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9014","title":"mrgsolve 0.8.10.9014","text":"Add OMEGA SIGMA matrices .list.mrgmod output names omat smat, respectively longer error attempt update slots OMEGA SIGMA matrices matrices slot long update empty list matrix zero rows Fix segmentation fault data set idata set used simulation certain mis-matches ID content two (#352)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109013","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9013","title":"mrgsolve 0.8.10.9013","text":"Removes mtime code (wasn’t use)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109012","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9012","title":"mrgsolve 0.8.10.9012","text":"Use dplyr::filter_ filter_.ev","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109011","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9011","title":"mrgsolve 0.8.10.9011","text":"mtime clear bug","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109010","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9010","title":"mrgsolve 0.8.10.9010","text":"Fixed bug filter.ev method","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109009","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9009","title":"mrgsolve 0.8.10.9009","text":"Added mutate_sims filter_sims work mrgsims (output) objects, modifying data slot returning modified mrgsims object rather data.frame Added plot_sims function takes data frame simulated output generates plot using mrgsims method","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109008","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9008","title":"mrgsolve 0.8.10.9008","text":"Changed id argument ID ev_rep ev_seq; warning issued id used Added data_qsim creating input data sets use qsim Fixed bug time dose correctly calculated additional doses lag time #327 Added read_nmext read nonmem model output .ext file","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109007","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9007","title":"mrgsolve 0.8.10.9007","text":"Clean re-organize Rd files; -logical grouping ordering","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109006","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9006","title":"mrgsolve 0.8.10.9006","text":"Stop importing assertthat lazyeval","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-8-10-9005","dir":"Changelog","previous_headings":"","what":"New Features","title":"mrgsolve 0.8.10.9005","text":"Added better support writing model files extension. example, mread(\"mymodel.txt\") read file mymodel.txt exists. However, default behavior remains unchanged mread(\"mymodel\") expect find model file mymodel.cpp.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bug-fixes-0-8-10-9005","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"mrgsolve 0.8.10.9005","text":"Fixed bug MD5 value model file calculated certain project path formulations #315","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-8-10-9005","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.8.10.9005","text":"realize_addl function re-factored better account time-varying data items; option provided seeing rows inserted data set whether make assumptions data rows mrgsolve longer utilizes functions XML package. previous functionality depended XML now depends xml2. , xml2 listed Suggests dependency. using $NMXML, $OMEGA $SIGMA matrices now loaded default; see new default arguments mrgsolve:::nmxml","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"documentation-0-8-10-9005","dir":"Changelog","previous_headings":"","what":"Documentation","title":"mrgsolve 0.8.10.9005","text":"Added solversettings help topic identifies DLSODA inputs can tweak Improved documentation update method well mrgmod-class","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-8-10-9003","dir":"Changelog","previous_headings":"","what":"New Features","title":"mrgsolve 0.8.10.9003","text":"Bioavailability specified $MAIN accounted simulating qsim; still bioavailability adjustment infusions lag times adjustments doses Added capability rename data items $CAPTURE; also, names partially sanitized, removing parens brackets. example $CAPTURE WT = WGT ETA(1) TVCL = THETA1 Added qsim_df function, returning data frame rather matrix Added .list method mrgsims objects Added deep argument .list method mrgmod object; taking lot time return function set, now get deep = TRUE Added mrgsim variant functions explicit input requirements written function name. example, call mrgsim_e simulate event object, mrgsim_d simulate data frame. functions called mrgsim. Added method event objects can passed data_set; also, coercing event objects data_set passed data Added .equal.mrgmod function compare two model objects. function returns logical () Added env_get_env always just returns model environment; identical result env_get(mod, tolist = FALSE) Change mread_cache mcode_cache cache invalidated preclean argument TRUE","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bug-fixes-0-8-10-9003","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"mrgsolve 0.8.10.9003","text":"Fixed bug preventing simulation qsim event","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"functions-removed-0-8-10-9003","dir":"Changelog","previous_headings":"","what":"Functions removed","title":"mrgsolve 0.8.10.9003","text":"mrgsolve_example mrgsolve_template; deprecated previously warning; use modlib() models instead","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109002","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9002","title":"mrgsolve 0.8.10.9002","text":"Added mrgsim_df function return data frame rather mrgsims object","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-08109001","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10.9001","title":"mrgsolve 0.8.10.9001","text":"model environment automatically imported _env mrgx plugin invoked","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0810","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.10","title":"mrgsolve 0.8.10","text":"CRAN release: 2017-11-01 Release CRAN","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0899004","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.9.9004","title":"mrgsolve 0.8.9.9004","text":"Added file argument mread allow coding model specification files extension. current behavior continues assuming model .cpp file, using file argument allows file name model specification. Added nocb argument mrgsim. nobc TRUE (default), mrgsim continues use next observation carried forward advance system time-varying parameters (including covariates). nocb FALSE, mrgsim use last observation carried forward (locf) advance system time-varying parameters.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-0899003","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.9.9003","title":"mrgsolve 0.8.9.9003","text":"Minor improvements documentation","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bug-fix-0-8-9-9002","dir":"Changelog","previous_headings":"","what":"Bug Fix","title":"mrgsolve 0.8.9.9002","text":"Fixed bug deslist created wrong order Fixed bug infusion duration incorrect paired non-zero lag time (test added) Fixed bug self object correctly updated first record individual (#273)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-8-9-9002","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.8.9.9002","text":"Add support dosing records lag time ss flag; error message generated lag time greater ii lag time + infusion duration greater ii. behavior ev_assign changed unique values evgroup sorted prior making event assignments. Details new behavior now included R help topic.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-8-6-9000","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.8.6.9000","text":"bioavailability parameter now gets updated every dose, regardless whether explicitly coded data set implicitly via addl. previous behavior bioavailability parameter locked value time initiating dose implemented Updated package dependency requirements. Notably, mrgsolve now requires Rcpp >= 0.12.12 dplyr >= 0.7.1","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-8-6-9000","dir":"Changelog","previous_headings":"","what":"New Features","title":"mrgsolve 0.8.6.9000","text":"Dosing records ss=2 recognized, allowing combining steady-state dosing regimens linear kinetics (e.g. 10 mg QAM 20 mg QPM) (#221) Added function (inventory) reconciles model parameters names object (e.g. simulation data set) verify required parameters can found data object.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-8-6-9000","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.8.6.9000","text":"PR #214 @dastoor fixes compatibility issue new dplyr Fixed bug deslist implementation (#222) PR #238 fixes incorrect steady-state values dose associated lagtime (#239)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-084","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.4","title":"mrgsolve 0.8.4","text":"Reconfigure use function pointer unit tests","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-083","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.3","title":"mrgsolve 0.8.3","text":"Bug fix prevented installation Solaris","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-082","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.8.2","title":"mrgsolve 0.8.2","text":"CRAN release: 2017-03-11 first release CRAN","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-authors-0-7-7","dir":"Changelog","previous_headings":"","what":"New Authors","title":"mrgsolve 0.7.7","text":"Devin Pastoor now listed contributor. Thanks help!","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-7-7","dir":"Changelog","previous_headings":"","what":"New Features","title":"mrgsolve 0.7.7","text":"Added automatic, -demand output time--dose (tad) simulated output. Use mrgsim(tad=TRUE). Several new functions added $PLUGIN mrgx, including mrgx::get<T> getting objects $ENV package namespace mrgx::mt_fun() just function can assign declaring Rcpp::Function. Added object argument idata_set data_set get data.frame (function call returns data.frame) $ENV use simulation.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"changes--additions-0-7-7","dir":"Changelog","previous_headings":"","what":"Changes / additions","title":"mrgsolve 0.7.7","text":"Added cmt argument $PKMODEL. cmt set character vector comma-separated string, $PKMODEL infers number compartments declares model. means separate $CMT block required using $PKMODEL. Added cols argument as_bmat as_dmat character vector names can specified (rather regular expression) select data creating matrix. preclean argument now causes unlink called model build directory. Added several functions help work $ENV: ls_env, get_env, re_eval_env, update_env. dose administered compartment , compartment now turned dosing allowed proceed. change previous behavior, error generated.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-7-6","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.7.6","text":"table() macro $TABLE now deprecated (#129). get derived values simulated output, users assign type double list variable name $CAPTURE. See also capture typedef introduced . mrgx plugin completely removed. Parameter updates via param method signature missing check names input parameters names existing parameters. error generated user attempts update parameter doesn’t exist. Note apply param method signature list (#144). git repository re-organized package lives base directory (#171).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"features-0-7-6","dir":"Changelog","previous_headings":"","what":"Features","title":"mrgsolve 0.7.6","text":"Added @ macros indicating block options model specification file. Added qsim function quick(er) simulation runs just one parameter set. Added recmatrix creates matrix simulation template qsim. Added mrgsolve:::render create document overview model contents. Methods mrgmod objects character strings pointing model file. Use mrgsolve:::details extract model annotation. Added capture typedef model specification file. Variables type capture doubles automatically appended $CAPTURE. capture typedef allowed $ODE probably reserved $TABLE. simeta available $MAIN simeps available $TABLE default, $PLUGIN required. Better support including R objects model via $ENV (#158). Added assign_ev function help build simulation data sets event objects (#164). Added as_data_frame method tibble package (#166). annotating model blocks, mrgsolve takes last parens item “units” last bracketed item “options” Added $ operator mrgmod objects return value parameter. Added mread_cache mcode_cache functions build cache model (#143).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-7-6","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.7.6","text":"Fixed documentation issue PKMODEL. volumes two-compartment model depot V1/V2. Fixed bug knobs output column names malformed user $CAPTUREs parameter also tweaked knob. Fixed bug annotated model specification multiple unit option specifications made.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"under-the-hood-0-7-6","dir":"Changelog","previous_headings":"","what":"Under the hood","title":"mrgsolve 0.7.6","text":"User-declared double/int/bool $MAIN, $ODE, $TABLE kept unnamed namespace local file. Started re-organize .R files. mrgsolve:::details returns data frame information regardless whether model annotated (#165). mrgsolve::details additional arguments help control output. Removed pkevent class; records datarecord.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"features-0-7-5","dir":"Changelog","previous_headings":"","what":"Features","title":"mrgsolve 0.7.5","text":"Added annotated code blocks $PARAM, $FIXED, $THETA, $CMT, $INIT, $VCMT. (#107) mrgsolve:::house() model re-coded annotated model. Re-implemented $ENV allow users create R objects can used certain points parsing model. (#115) Added >> signifier code blocks allow options; >> beginning line indicates name=value statements follow parsed block options. Added object argument following blocks: $PARAM, $OMEGA, $SIGMA, $FIXED, $CMT. object set character string naming object $ENV, object used form output block.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-7-5","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.7.5","text":"Fixed bug caused simulation run hang implementing dose small lag time. (#109) Fixed bug valid.numericlist wasn’t returning FALSE improperly-formed objects.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"under-the-hood-0-7-5","dir":"Changelog","previous_headings":"","what":"Under the hood","title":"mrgsolve 0.7.5","text":"Now using environment collect objects parsing model specification file. small changes C++ code calculates compartment amounts closed form one- two-compartment models resulting faster simulation runs.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-074","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.7.4","title":"mrgsolve 0.7.4","text":"modmrg package discontinued. pre-coded models now available mrgsolve. Simply call mread model stem (e.g. pk1cmt, irm3, etc …) call modlib() project argument. example: mod <- mread(\"emax\", modlib()) compile emax model return model object.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-073","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.7.3","title":"mrgsolve 0.7.3","text":"Tests re-configured Fixed issue record sorting lagged doses using full data_setand obsaug=TRUE (#102) Fixed issue idata_set wasn’t handled properly passed tbl (#100)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-072","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.7.2","title":"mrgsolve 0.7.2","text":"Addressed issue model compilation Windows systems failed certain symbol names used model (#97). release, dllname-win.def file created soloc export functions mrgsolve needs use. relevant Windows platform. Added check project argument mread: newline(s) found, error generated user prompted use mcode instead. Several changes hood (#99)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-071","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.7.1","title":"mrgsolve 0.7.1","text":"Fixed bug requested columns properly named certain circumstances (#86).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"mrgsolve-070","dir":"Changelog","previous_headings":"","what":"mrgsolve 0.7.0","title":"mrgsolve 0.7.0","text":"Revert back previous behavior cwd soloc required build model. required Windows systems space file name. Correctly rendering path build directory now.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"features-0-6-1","dir":"Changelog","previous_headings":"","what":"Features","title":"mrgsolve 0.6.1","text":"Added as_data_set convert one event objects data frame can passed data_set. something similar expand.ev, control. special column names (time, amt, rate, evid, ii, addl ,ss, cmt) either lower case upper case names recognized. determination made time / TIME column (always required using data set). time mrgsolve continue looking lower case names; TIME look upper case names. warning issued case upper lower case names included. Added $PLUGIN let users extend model specification file. Valid plugins include simeta, Rcpp, RcppArmadillo, BH. plugin used, mrgsolve link back appropriate package possibly include appropriate header files compiling model. example, simeta link back mrgsolve RcppArmadillo allow modeler simulate new set ETAs. Use Rcpp plugin simulate random variates common distributions R(e.g. rnorm, rexp etc … ).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-6-1","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.6.1","text":"Fixed issue ev rows returned amt wasn’t supplied (#44). Shortened path shared object name .cpp.cpp file compiling. Fixed bug touch_funs large number (> 25) ETAs model (#68).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-6-1","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.6.1","text":"using $PKMODEL ncmt=2 depot=FALSE, default PK parameters CL, V1 (central volume), Q, V2 (peripheral volume). change previous volumes V2 (central) V3 (peripheral). $CAPTURE now saves output items slots std::vector<double>, rather std::map<std::string,double>. ’ve known std::map wasn’t efficient especially large simulations. Currently, items $TABLE still saved std::map table() macro. plan going forward eliminate table map force output variables $CAPTURE. Due major changes dplyr, now requiring dplyr >= 0.5.0 (#69) data slot mrgsims objects now data.frame knobs function plot method re-written. Overall behavior applications .","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"under-the-hood-0-6-1","dir":"Changelog","previous_headings":"","what":"Under the hood","title":"mrgsolve 0.6.1","text":"C++ symbols model functions now stored model object (funs slot) status model object (function names compile status) can checked mrgsolve:::funset(mod) model considered loaded ready go functions funs can found .loaded Model shared objects still stored within soloc directory (default tempdir()), mrgsolve create subdirectory structure organize compilation artifacts. outer directory keyed based current mrgsolve version number computer platform. Inner directories based model name (model(mod)). source file created based model name shared object created based name. compilation successful, shared object (.mac/unix, .dll Windows) copied ..dll file unique stem (e.g. model2lj239wsfo.). unique shared object loaded R process use model. Every time model rebuilt, build directory scanned shared object files. Excluding main model shared object (unchanging name based model), old shared object files deleted , currently loaded (getLoadedDLLs()), attempted dyn.unloaded. Upon model rebuild (via mread mcode), changes source .cpp file, source overwritten. case, make re-build shared object. Using preclean argument force re-compilation (see R CMD SHLIB). header files modelheader.h mrgsolv.h longer copied project directory. CLINK_CPPFLAGS environment variable modified include <path--mrgsolve-package>/inst/base may linked. R CMD SHLIB build process always uses intern=TRUE output suppressed Windows mac/unix. user may still request view build output ignore.stdout argument. Model build always links-project directory look C++ header files. including header file may change build build, always run preclean=TRUE. mrgsolve now changes working directory prior building model. working directory restored exit mread.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"deprecated-0-6-1","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"mrgsolve 0.6.1","text":"comp_forget message issued complog message issued trequest argument mrgsim","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-6-0","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.6.0","text":"Fixed bug infusion attempted rate > 0 amt==0. Additionally, error generated infusion attempted zero amt (#43).","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-5-12","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.5.12","text":"Fixed bug infusion dosing events evid 4 properly implemented. investigating issue, also found similar issue evid 4 infusions getting scheduled addl (#31). Removed NSE evaluation arguments passed ev avoid unintended issues evaluation (#29).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-5-12","dir":"Changelog","previous_headings":"","what":"New features","title":"mrgsolve 0.5.12","text":"Added mcode function alternative using mread model written R string. Note order arguments: first model, code, project. project defaults tempdir. call : mod <- mcode(\"mymodel\", code). equivalent mread call : mod <- mread(\"mymodel\", tempdir(),code). carry.() Req() now take newname = oldname input. Use syntax carry.want copy column input data set simulated data set, changing column newname oldname. Use syntax Req want change names compartments output variables specified $TABLE / $CAPTURE. Added pkmodel function easy loading simulating 1- 2-compartment models (#39). Added new code block: $PKMODEL simulating PK model analytical solutions. main option block ncmt, picks number compartments pk model. See ?PKMODEL information options (#34).","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"under-the-hood-0-5-12","dir":"Changelog","previous_headings":"","what":"Under the hood","title":"mrgsolve 0.5.12","text":"Added code attribute mrgmod objects. actual source code stays model object. see modified look x@code first showing model code. Added tokenizer function (get_tokens), wrapper boost tokenizer) help checking model specification file. Data items entered $FIXED now implemented C++ preprocessor directives default rather const double variables. Use $SET fixed_type = \"define\" $SET fixed_type = \"const\" select approaches.","code":""},{"path":[]},{"path":"https://mrgsolve.org/docs/news/index.html","id":"bugs-fixed-0-5-11","dir":"Changelog","previous_headings":"","what":"Bugs fixed","title":"mrgsolve 0.5.11","text":"Added missing example model specification files (popExample, viralExample, others) Added mindt attribute mrgmod objects default value .Machine$double.eps*10. problem includes infusion, calculated end infusion may come close another record. Usually solver fail message DLSODA- TOUT(=R1) close T(=R2) start integration.. fix , set mindt greater zero small … maybe 1E-12. mindt greater zero tto - tfrom (times two adjacent records) less mindt, mrgsolve set tto equal tfrom (#9). zero.re didn’t properly update $SIGMA list one matrix named another unnamed. fixed. (#16) Fixed bug infusions ss=1 caused mrgsolve/R crash infusion duration equal multiple dosing interval. (#19) Fixed bug setting F_CENT zero gave undefined behavior. mrgsolve issue error F_CMT set zero ss flag set 1. (#22) Fixed bug dosing records evid=4 (reset system dose) addl > 0 reset system subsequent doses. Additional doses coming records evid=4 system reset. (#23)","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"important-changes-0-5-11","dir":"Changelog","previous_headings":"","what":"Important changes","title":"mrgsolve 0.5.11","text":"New arguments $NMXML (see ?nmxml) easier understand consistent new prefixes labels ETA EPS. name argument removed. Use tname (provide prefix THETAs), oname (name OMEGA matrix), sname (name SIGMA matrix) instead. general, set theta TRUE import THETAs, set omega TRUE import OMEGA, set sigma TRUE import SIGMA. Specifying character names tname, oname, sname imply theta=TRUE, omega=TRUE, sigma=TRUE, respectively.","code":""},{"path":"https://mrgsolve.org/docs/news/index.html","id":"new-features-0-5-11","dir":"Changelog","previous_headings":"","what":"New features","title":"mrgsolve 0.5.11","text":"New aliases available setting bioavailability, lag time infusion duration rate. compartment called DEPOT use: F_DEPOT (bioavailability), ALAG_DEPOT (dosing lag time), D_DEPOT (infusion duration), / R_DEPOT (infusion rate). (#13) Added slightly informative messages DLSODA fails, including clear identification value istate, 2 solver succeeds negative solver fails. Added labels prefix options $OMEGA $SIGMA. allow descriptive aliases ETAs … e.g. using ETA_CL rather ETA(1). (#15) Added dplyr::slice method mrgsims objects (#11) New argument mread: quiet. Setting quiet TRUE prevent printing messages mread called. default getOptions(\"mrgsolve_mread_quiet\",FALSE) … can call options(mrgsolve_mread_quiet = TRUE) globally turn messages mread.","code":""}]