Releases: nlmixrdevelopment/RxODE
v1.1.4
RxODE 1.1.2
RxODE 1.1.2
-
Fix subject initialization of
focei
problem (#464) -
Fix LHS offset to allow internal threading and more parallel
processing in the future. -
Remove warnings for duration and rate
-
Don't export pillar methods any more (simply register at load if present)
-
As requested by CRAN, change fortran and C binding for BLAS an LINPACK
What's Changed
- Issue 464 try2 by @mattfidler in #466
- Avoid exporting pillar methods by @krlmlr in #467
New Contributors
Full Changelog: v1.1.1...v1.1.2
RxODE 1.1.1
-
Fix the LTO issue that CRAN identified.
-
Move the omp files so they come first to support clang13, as identified by CRAN.
-
For now, be a little more conservative in
dur()
andrate()
warnings becauselinCmt()
models innlmixr
currently produce
irrelevant warnings.
RxODE 1.1.0
RxODE 1.1.0
-
Always calculate "nolhs" for using numeric differences when the
inner problem. This allows the inner problem to fallback to a finite
difference approximation to the focei objective function. -
Updated the parser C code grammar using latest dparser CRAN package
-
Added a new cbind function that is used to mix data frame input with
simulated individual parameters and residual parameters,
rxCbindStudyIndividual()
. -
Now data frame input can be mixed with simulating from omega and
sigma matrices (though not yet in nested simulations) -
Race conditions when simulating random numbers is solved by chunking
each simulation into groups that will always be performed per each
thread. This way the simulation is now reproducible regardless of
load. Because of the chunking, simulations with random numbers generated
inside of it are now threaded by default (though a warning is
produced about the simulation only be reproducible when run with the
same number of threads) -
Simulations were double checked and made sure to use the engine
reserved for each core run in parallel; Some of the random
generators were not taking random numbers from the correct engine,
which was corrected. Therefore, simulations from this version are
expected to be different (in parallel) than previous versions. -
Added function
rxSetSeed()
to set the internal RxODE seed instead
of grabbing it from a uniform random number tied to the original R
seed. This will avoid the possibility of duplicate
seeds and is the best practice. -
Updating parameter pointers is done once per ID and locked based on
ID to remove the recursion in #399, but still have the correct
behavior see #430 -
Parsing updated to retain "param()" in normalized model, #432.
-
Handle edge case of interpolation at first index correctly, fixes #433
-
Instead of storing each dose information sequentially, store dose
information at the same index of theevid
defining the dose. This
memory rewrite is to fix the issue #435. -
Start using strict headers as it is required for the forthcoming
release ofRcpp
. Thanks to Dirk Eddelbuettel for some of the
fixes and alerting us to this change. -
Check arguments for
add.dosing()
more strictly. See Issue #441 -
Issue a warning when either
dur()
orrate()
is in the model but
the modeled rate and duration is not included in the event table. -
When the data requires a modeled rate and modeled duration but it is
not in the model, warn about the mismatch in data -
Added a back-door for debugging. If you specify
options(RxODE.debug=TRUE)
then each solve saves the solving
information to the file"last-rxode.qs"
before actually solving
the system. -
Only will try to solve RxODE problems on compatible models; If the
model is not supported it will throw an error instead of crashing
(See #449) -
Turn off parallel ODE solving whenever the system needs to sort
times based on model dosing. Currently this type of solving is not
thread safe. -
Update timsort headers to latest version.
RxODE 1.0.9
RxODE 1.0.9
-
At the request of CRAN, stripping the debugging symbols for the CRAN
release is no longer performed. This means a larger binary size for
RxODE in this release. -
At the request of CRAN the
liblsoda
code has been changed so that
the memory in C defined by_C()
is now defined by_rxC()
. This
will be seen in some of the error messages, which will no longer
match the error messages of unmodified liblsoda. -
iCov
behavior has shifted to merge on the input event dataset.
See Issue #409; This is more in line with expectations ofiCov
behavior, and reduces the amount of code needed to maintainiCov
.The
iCov
in the pipeline is no longer supported because it simply
is a merge with the event dataset.This can be a breaking change depending on the code you use. Note
that clinical trial simulations, resampling is likely better than
trying to fill outiCov
for every individual which was the prior
use. -
Bug fix for crashes with string covariates or factor covariates,
issue #410. Also factor column names are compared with case
insensitivity just like the rest of the column names for event
tables or data sets inRxODE
.
v1.0.8
v1.0.7
-
Change syntax vignette to use markdown option
screenshot.force=FALSE
. This should get rid of thewebshot
error -
Change to depend on dparser 1.3.0, which has some memory fixes
v1.0.6
RxODE 1.0.6
-
RxODE imports but does not link to
checkmate
any longer. This change
should make recompilation of RxODE to work with different releases
ofcheckmate
unnecessary. -
Default Solaris solver changed back to "lsoda"
-
Fix Bug #393, where in certain circumstances
rxSolve(...,theta=)
did not solve for all subjects. -
Will not ignore NEWS and README when building the package so that
they will show up on CRAN. You can also access the news by
news(package="RxODE")
-
Changed
ODR
model names from time id to_rx
followed by the
md5
hash id and a per-session counter id; For packages the id is
_rxp
followed by themd5
hash and a per-session counter id. -
Changed
qs
to be more conservative in hash creation. Add a check
hash as well as NOT using altrep stringfish representation.
v1.0.5
-
Maintainance release -- use
std::floor
and cast variables to
double
for internal C functions. This should allow a successful
compile on Solaris CRAN. -
Changed
units
from an Imports to a Suggests to allow testing on
Solaris rhub -
Changed
ODR
model names from time id to_rx
followed by the
md5
hash id; For packages the id is_rxp
followed by themd5
hash. -
Removed AD linear compartment solutions for Windows R 3.6, though
they still work for Windows R 4.0 (You can get them back for Windows
R 3.6 if you installBH
1.66.0-1 and then recompile from source).- This will cause
nlmixr
to fail with solved systems on Windows 3.6.
Currently the Stan Headers do not compile on this system so they are
disabled at this time.
- This will cause
-
RxODE imports but does not link to
qs
any longer; This change
should make recompilation of RxODE to work with different releases
ofqs
unnecessary. -
RxODE now checks for binary compatibility for
Rcpp
,dparser
,
checkmate
, andPreciseSums
v1.0.4
Breaking changes
-
RxODE can only use supported functions (could be breaking); You may
add your own functions withrxFun
and their derivatives withrxD
-
RxODE now uses its own internal truncated multivariate normal
simulations based on the threefry sitmo library. Therefore random
numbers generated withinRxODE
like providing
rxSolve(...,omega=)
will have different results with this new
random number generator. This was done to allow internal re-sampling
of sigmas/etas with thread-safe random number generators (calling R
throughmvnfast
or R's simulation engines are not thread safe). -
RxODE
now moved the precise sum/product type options forsum()
andprod()
torxSolve
orrxControl
-
cvPost
now will returned a named list of matrices if the input
matrix was named -
rxSolve
will now return an integerid
instead of a factorid
whenid
is integer or integerish (as defined by checkmate).
Otherwise a factor will be returned. -
When mixing ODEs and
linCmt()
models, thelinCmt()
compartments
are 1 and possibly 2 instead of right after the last internal ODE.
This is more aligned with how PK/PD models are typically defined. -
EVID=3
andEVID=4
now (possibly) reset time as well. This
occurs when the input dataset is sorted before solving. -
When
EVID=2
is present, anevid
column is output to distinguish
evid=0
andevid=2
New features
-
Add the ability to order input parameters with the
param()
pseudo-function -
Add the ability to resample covariates with
resample=TRUE
or
resample=c("SEX", "CRCL")
. You can resample all the covariates by
ID
withresampleID=TRUE
or resample the covariates without
respect toID
withresampleID=FALSE
-
Comparison of factors/strings is now supported in
RxODE
; Therefore
ID=="Study-1" is now allowed. -
Completion for elements of
rxSolve()
objects, andet()
objects have been added (accessed through$
) -
Completion of
rxSolve()
arguments are now included since they are
part of the main method -
Allow simulation with zero matrices, that provide the simulation
without variability. This affectsrxSolve
as well asrxMvnrnd
and
cvPost
(which will give a zero matrix whenever one is specified) -
et()
can dose withlength(amt) > 1
as long as the other
arguments can create a event table. -
Rstudio notebook output makes more sense
-
Printing upgraded to cli 2.0
-
Caching of internal C data setup is now supported increasing speed
ofoptim
code when:- Event Table doesn't change
- The size of the parameters doesn't change
inits
do not change (though you can specify them ascmt(0)=...
in the model and change them by parameters)- See Issue #109
-
Allow
while(logical)
statements with ability to break out if them
bybreak
. The while has an escape valve controlled bymaxwhere
which by default is 10000 iterations. It can be change with
rxSolve(..., maxwhere = NNN)
-
Allow accessing different time-varying components of an input
dataset for each individual with:lag(var, #)
lead(var, #)
first(var)
last(var)
diff(var)
Each of these are similar to the R lag
, lead
, first
, last
and
diff
. However when undefined, it returns NA
-
Allow sticky left-handed side of the equation; This means for an
observation the left handed values are saved for the next
observations and then reassigned to the last calculated value.This allows NONMEM-style of calculating parameters like tad:
mod1 <-RxODE({
KA=2.94E-01;
CL=1.86E+01;
V2=4.02E+01;
Q=1.05E+01;
V3=2.97E+02;
Kin=1;
Kout=1;
EC50=200;
C2 = centr/V2;
C3 = peri/V3;
d/dt(depot) =-KA*depot;
d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3;
d/dt(peri) = Q*C2 - Q*C3;
d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff;
if (!is.na(amt)){
tdose <- time
} else {
tad <- time - tdose
}
})
It is still simpler to use:
mod1 <-RxODE({
KA=2.94E-01;
CL=1.86E+01;
V2=4.02E+01;
Q=1.05E+01;
V3=2.97E+02;
Kin=1;
Kout=1;
EC50=200;
C2 = centr/V2;
C3 = peri/V3;
d/dt(depot) =-KA*depot;
d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3;
d/dt(peri) = Q*C2 - Q*C3;
d/dt(eff) = Kin - Kout*(1-C2/(EC50+C2))*eff;
tad <- time - tlast
})
If the lhs
parameters haven't been defined yet, they are NA
-
Now the NONMEM-style
newind
flag can be used to initializelhs
parameters. -
Added
tad()
,tad(cmt)
functions for time since last dose and time
since last dose for a compartment; Also added time after first dose
and time after first dose for a compartmenttafd()
,tafd(cmt)
;
time of last dosetlast()
,tlast(cmt)
and dose number
dosenum()
(currently not for each compartment) -
Changed linear solved systems to use "advan" style
linCmt()
solutions, to allow correct solutions of time-varying covariates
values with solved systems; As such, the solutions may be slightly
different. Infusions to the depot compartment are now supported. -
Added sensitivity auto-differentiation of
linCmt()
solutions.
This allows sensitivities oflinCmt()
solutions and enables
nlmixr
focei to support solved systems.- One solution is to use Stan's auto-differentiation which requires
C++14
- One solution is to use Stan's auto-differentiation which requires
-
When calculating the empirical Bayesian estimates for with
rxInner
(used for nlmixr's 'focei') ignore any variable beginning withrx_
andnlmixr_
to hide internal variables from table output. This
also addedtad=tad()
anddosenum=dosenum()
to theebe
output
allowing grouping by id, dose number and use TAD for individual plot
stratification. -
Added ability to prune branching with
rxPrune
. This converts
if
/else
orifelse
to single line statements without any
if
/then
branching within them. -
Added ability to take more complex conditional expressions, including:
ifelse(expr, yes, no)
x = (x==1)*1 + (!(x==1))*2
if (logic){ expr} else if (logic) {expr} else {}
. The preferred
syntax is still onlyif
/else
and the corresponding parsed code
reflects this preference.- Note
ifelse
is not allowed as an ODE compartment or a variable.
- Note
-
Switched to
symengine
instead of usingsympy
- Remove dependence on python.
- Since symengine is C-based and doesn't require the python
interface it is much faster thansympy
, though some functions in
sympy
are no longer accessible. - Also symengine requires R 3.6, so now RxODE requires R 3.6
-
Added new ODE solving method "indLin", or inductive linearization.
When the full model is a linear ODE system this becomes simply the
matrix exponential solution. Currently this requires a different
setup. -
Added arbitrary function definition to RxODE using
rxFun
- Requires function, arguments and corresponding C-code
- Derivatives (if required) can be added to the derivative table
rxD
. When taking deviates without a derivative function, RxODE
will use numerical differences.
-
Will error if RxODE does not know of a function that you are trying
to use; This could be a breaking change. Currently:- C's functions from
math.h
are supported - R's function returning and taking doubles are supported
- Other functions can be added using
rxFun
andrxD
- C's functions from
-
Added
NA
,NaN
,Inf
and+Inf
handling to a RxODE model. Can
be useful to diagnose problems in models and provide alternate
solutions. In addition, added R-like functionsis.nan
,is.na
,
is.finite
andis.infinite
which can be called within the RxODE
block. -
Allowed the following data variables can be accessed (but not
assigned or used as a state):cmt
dvid
addl
ss
amt
rate
id
which requires calling the id as factorID=="1"
for
instance.
-
Kept
evid
andii
as restricted items since they are not part of
the covariate table and are restricted in use. -
Added the following random number generators; They are thread safe
(based onthreefry
sitmo
and c++11) and your simulations with
them will depend on the number of cores used in your simulation (Be
careful about reproducibility with large number of threads; Also
use parallel-solve type of RxODE simulations to avoid the birthday
problem).During ODE solving, the values of these are
0
, but while
calculating the final output the variable is randomized at least for
every output. These are:rxnorm()
andrxnormV()
(low discrepancy normal)rxcauchy()
rxchisq()
rxexp()
rxf()
rxgamma()
rxbeta()
rxgeom()
rxpois()
rxt()
rxunif()
rxweibull()
In addition, while initializing the system, the following values are
simulated and retained for each individual:rinorm()
andrinormV()
(low discrepancy normal)ricauchy()
richisq()
riexp()
rif()
rigamma()
ribeta()
rigeom()
ripois()
rit()
riunif()
riweibull()
-
Added
simeta()
which simulates a neweta
when called based
on the possibly truncated normalomega
specified by the original
simulation. This simulation occurs at the same time as the ODE is
initialized or when an ODE is missing, before calculating the final
output values. Theomega
will reflect whatever study is being simulated. -
Added
simeps()
which simulates a neweps
from the possibly
truncated normalsigma
at...