Releases: metrumresearchgroup/mrgsolve
Releases · metrumresearchgroup/mrgsolve
mrgsolve 0.6.0
Bugs fixed
- Fixed a bug where infusion dosing events with
evid 4
were not properly implemented. While investigating that issue, also found similar issue withevid 4
infusions getting scheduled withaddl
(issue 31). - Removed NSE evaluation for arguments passed into
ev
to avoid unintended issues in evaluation (issue 29).
New features
- Added
mcode
function as alternative to usingmread
when your model is written in anR
string. Note the order of the arguments:
firstmodel
, thencode
, thenproject
.project
defaults totempdir
. So the call is:mod <- mcode("mymodel", code)
. The
equivalentmread
call is:mod <- mread("mymodel", tempdir(),code)
. carry.out()
andReq()
now takenewname = oldname
as input. Use this syntax incarry.out
when you want to copy a column from the input data set into the simulated data set, changing the column tonewname
fromoldname
. Use this syntax inReq
when you want to change the names of compartments or output variables spcified in$TABLE
/$CAPTURE
.- Added
pkmodel
function for easy loading and simulating from 1- and 2-compartment models (issue 39). - Added new code block:
$PKMODEL
for simulating PK model with analytical solutions. The main option for this block isncmt
, which picks the number of compartments for the pk model. See?PKMODEL
for more information and other options (issue 34).
Under the hood
- Added
code
attribute tomrgmod
objects. The actual source code stays with the model object.see
was modified to look atx@code
first when showing the model code. - Added a tokenizer function (
get_tokens
), a wrapper for the boost tokenizer) to help checking the model specification file. - Data items entered in
$FIXED
are now implemented as C++ preprocessor directives by default rather thanconst double
variables. Use$SET fixed_type = "define"
or$SET fixed_type = "const"
to select between the approaches.
mrgsolve 0.5.12
Bugs fixed
- Added missing example model specification files (popExample, viralExample, others)
- Added
mindt
attribute tomrgmod
objects with default value of.Machine$double.eps*10
. When the problem includes an infusion, the calculated end of the infusion
may come too close to another record. Usually the solver will fail with the messageDLSODA- TOUT(=R1) too close to T(=R2) to start integration.
. To fix this,mindt
is set to be greater than zero but small. Whenmindt
is greater than zero andtto - tfrom
(the times of two adjacent records) is less thanmindt
,mrgsolve
will settto
equal totfrom
(issue 9). zero.re
didn't properly update the$SIGMA
list when one matrix was named and another was unnamed. This has been fixed. (issue 16)- Fixed a bug where infusions with
ss
=1 causedmrgsolve
/R
to crash when the infusion duration was equal to or some multiple of the dosing interval. (issue 19) - Fixed a bug where setting
F_CENT
to zero gave undefined behavior.mrgsolve
will issue an error ifF_CMT
is set to zero and thess
flag is set to 1. (issue 22) - Fixed bug where dosing records with
evid=4
(reset the system and dose) andaddl > 0
reset the system for all subsequent doses. Additional doses coming from records withevid=4
will not do system reset. (issue 23)
Important changes
- New arguments for
$NMXML
(see?nmxml
) that are easier to understand and consistent with new prefixes and labels forETA
andEPS
.name
argument is removed. Usetname
(to provide a prefix forTHETAs
),oname
(to name theOMEGA
matrix), andsname
(to name theSIGMA
matrix) instead. In general, settheta
to beTRUE
to importTHETAs
, setomega
to beTRUE
to importOMEGA
, and setsigma
to beTRUE
to importSIGMA
. Specifying character namestname
,oname
, andsname
will implytheta=TRUE
,omega=TRUE
, andsigma=TRUE
, respectively.
New features
- New aliases available for setting bioavailability, lag time and infusion duration and rate. For a compartment called
DEPOT
use:F_DEPOT
(bioavailability),ALAG_DEPOT
(dosing lag time),D_DEPOT
(infusion duration), and / orR_DEPOT
(infusion rate). (issue 13) - Added slightly more informative messages when
DLSODA
fails, including clear identification if the value ofistate
, which is 2 when the solver succeeds and negative when the solver fails. - Added
labels
andprefix
options to$OMEGA
and$SIGMA
. These allow descriptive aliases for ETAs ... e.g. usingETA_CL
rather thanETA(1)
. (issue 15) - Added
dplyr::slice
method formrgsims
objects (issue 11) - New argument to
mread
:quiet
. Settingquiet
toTRUE
will prevent printing messages whenmread
is called. The default isgetOptions("mrgsolve_mread_quiet",FALSE)
... so you can calloptions(mrgsolve_mread_quiet = TRUE)
to globally turn off messages frommread
.
mrgsolve 0.5.11
Bugs Fixed
- Fixed paths for project (
project
) and shared object (soloc
) so that "short" paths are used when compiling the model on Windows platforms (info issue 4 and here) - Fixed a bug where bioavailability fraction was not accounted for when setting infusion duration in
$MAIN
withrate=-2
(see issue 3) mrgsolve_example
prints a message telling the user to usemrgmod
to read and compile the model. The user should usemread
. The message has been updated. (info issue 5)- Fixed bug where parameters were not correctly read from first row of a data set when certain
recsort
options were selected (issue 6)
New Features
- Added
$ADVAN2
and$ADVAN4
for implementing one- and two-compartment PK models with analytical solutions rather than ODEs (thanks to contributions by Bill Gillespie and Charles Margossian) - Added
soloc
attribute added tomrgmod
and argument added tomread
, giving user control over where the shared object is stored; by default it is intempdir()
.soloc
needs to be set to local directory when usingqapply
- Added generics for various
dplyr_
functions so thatmrgsims
objects can be piped tomutate
,group_by
,filter
,summarise
,do
,select
, andsummarise.each
(it's a dot not an underscore). So:mod %>% mrgsim %>% mutate(group=1)
- You can now set initial conditions though
idata
; for compartmentCMT
, include a column inidata
calledCMT_0
- Modified update policy for
$OMEGA
and$SIGMA
: if all incoming matrices are unnamed and the signature matches the model object, the update will happen - Added
mcRNG
function as alias tobase::RNGkind("L'Ecuyer-CMRG")
Under the hood
- Changed dosing lag time mechanism so that lag times are calculated as the simulation progresses and dose times in the simulated output are as in the input data
- Model shared objects are given random names every time the model is compiled and loaded
- Changes to
recsort
: 1 and 2 will put explicit doses after observations at the same time, 3 and 4 will put explicit doses before observations at the same time. 2 and 4 will put doses scheduled through addl after observations at the same time; 1 and 3 put doses scheduled through addl before observations at the same tile - Various fixes and expansions to documentation
- Changed
R
dependency to>= 3.1.2
- All
Ops
involvingmrgmod
objects are now deprecated loadso
now returns the model object (invisibly)- Compartment names are automatically removed from table map
- Model specification files in need of compilation are detected via md5sum
- Minimum of 2 sec wait time is required before re-compiling a model
- Added
init
method with signaturemrgmod
,ANY
, withANY
getting coerced tolist