v2.1.0
rxode2 2.1.0
Breaking changes
-
Steady state with lag times are no longer shifted by the lag time
and then solved to steady state by default. In addition the steady
state at the original time of dosing is also back-calculated. If you
want the old behavior you can bring back the option with
ssAtDoseTime=FALSE
. -
"dop853" now uses the
hmax
/h0
values from therxControl()
or
rxSolve()
. This may change some ODE solving using "dop853" -
When not specified (and xgxr is available), the x axis is no longer
assumed to be in hours
New features
-
User defined functions can now be R functions. For many of these R
functions they can be converted to C withrxFun()
(you can see the
C code afterwards withrxC("funName")
) -
Parallel solving of models that require sorting (like modeled lag
times, modeled duration etc) now solve in parallel instead of downgrading
to single threaded solving -
Steady state infusions with a duration of infusions greater than the
inter-dose interval are now supported. -
Added
$symengineModelNoPrune
and$symengineModelPrune
for
loading models into rxode2 withrxS()
-
When plotting and creating confidence intervals for multiple
endpoint models simulated from a rxode2 ui model, you can
plot/summarize each endpoint withsim
. (ie.confint(model, "sim")
orplot(model, sim)
).If you only want to summarize a subset of endpoints, you can focus
on the endpoint by pre-pending the endpoint withsim.
For example
if you wanted to plot/summarize only the endpointeff
you would
usesim.eff
. (ieconfint(model, "sim.eff")
orplot(model, sim.eff)
) -
Added
model$simulationIniModel
which prepend the initial
conditions in theini({})
block to the classicrxode2({})
model. -
Now
model$simulationModel
andmodel$simulationIniModel
will save
and use the initialization values from the compiled model, and will
solve as if it was the original ui model. -
Allow
ini(model) <- NULL
to drop ini block andas.ini(NULL)
givesini({})
(Issue #523) -
Add a function
modelExtract()
to extract model lines to allow
modifying them and then changing the model by piping or simply
assigning the modified lines withmodel(ui) <- newModifiedLines
-
Add Algebraic mu-referencing detection (mu2) that allows you to
express mu-referenced covariates as:
cl <- exp(tcl + eta.cl + wt_cl * log(WT/70.5))
Instead of the
cl <- exp(tcl + eta.cl + wt_cl * log.WT.div.70.5)
That was previously required (where log.WT.div.70.5
was calculated
in the data) for mu expressions. The ui
now has more information to
allow transformation of data internally and transformation to the old
mu-referencing style to run the optimization.
-
Allow steady state infusions with a duration of infusion greater than
the inter-dose interval to be solved. -
Solves will now possibly print more information when issuing a
"could not solve the system" error -
The function
rxSetPipingAuto()
is now exported to change the way you
affect piping in your individual setup -
Allow covariates to be specified in the model piping, that is
mod %>% model(a=var+3, cov="var")
will add"var"
as a covariate. -
When calculating confidence intervals for
rxode2
simulated objects
you can now useby
to stratify the simulation summary. For
example you can now stratify by gender and race by:confint(sim, "sim", by=c("race", "gender"))
-
When calculating the intervals for
rxode2
simulated objects you
can now useci=FALSE
so that it only calculates the default
intervals without bands on each of the percentiles; You can also
choose not to match the secondary bands limits withlevels
but use
your ownci=0.99
for instance -
A new function was introduced
meanProbs()
which calculates the
mean and expected confidence bands under either the normal or t
distribution -
A related new function was introduced that calculates the mean and
confidence bands under the Bernoulli/Binomial distribution
(binomProbs()
) -
When calculating the intervals for
rxode2
simulated objects you
can also usemean=TRUE
to use the mean for the first level of
confidence usingmeanProbs()
. For this confidence interval you can
override then
used in the confidence interval by usingn=#
. You
can also change this to a prediction interval instead using
pred=TRUE
. -
Also when calculating the intervals for
rxode2
simulated object
you can also usemean="binom"
to use the binomial distributional
information (and ci) for the first level of confidence using
binomProbs()
. For this confidence interval you can override the
n
used in the confidence interval by usingn=#
. You can also
change this to a prediction interval instead usingpred=TRUE
. With
pred=TRUE
you can override the number of predicted samples with
m=#
-
When plotting the
confint
derived intervals from anrxode2
simulation, you can now subset based on a simulated value like
plot(ci, Cc)
which will only plot the variableCc
that you
summarized even if you also summarizedeff
(for instance). -
When the rxode2 ui is a compressed ui object, you can modify the ini
block with$ini <-
or modify the model block with$model <-
.
These are equivalent toini(model) <-
andmodel(model) <-
,
respectively. Otherwise, the object is added to the user defined
components in the function (ie$meta
). When the object is
uncompressed, it simply assigns it to the environment instead (just
like before). -
When printing meta information that happens to be a
lotri
compatible matrix, uselotri
to express it instead of the default
R expression. -
Allow character vectors to be converted to expressions for piping
(#552) -
rxAppendModel()
will now take an arbitrary number of models and
append them together; It also has better handling of models with
duplicate parameters and models withoutini()
blocks (#617 / #573
/ #575). -
keep
will now also keep attributes of the input data (with special
handling forlevels
); This means a broader variety of classes will
be kept carrying more information with it (for example ordered
factors, data frame columns with unit information, etc) -
Piping arguments
append
forini()
andmodel()
have been
aligned to perform similarly. Thereforeini(append=)
now can take
expressions instead of simply strings andmodel(append=)
can also
take strings. Also model piping now can specify the integer line
number to be modified just like theini()
could. Also
model(append=FALSE)
has been changed tomodel(append=NULL)
.
While the behavior is the same when you don't specify the argument,
the behavior has changed to align withini()
when piping. Hence
model(append=TRUE)
will append andmodel(append=FALSE)
will now
pre-pend to the model.model(append=NULL)
will modify lines like
the behavior ofini(append=NULL)
. The default ofmodel(line)
modifying a line in-place still applies. While this is a breaking
change, most code will perform the same. -
Labels can now be dropped by
ini(param=label(NULL))
. Also
parameters can be dropped with the idiommodel(param=NULL)
or
ini(param=NULL)
changes the parameter to a covariate to align with
this idiom of dropping parameters -
rxRename
has been refactored to run faster
Internal new features
-
Add
as.model()
for list expressions, which impliesmodel(ui) <- ui$lstExpr
will assign model components. It will also more
robustly work with character vectors -
Simulated objects from
rxSolve
now can access the model variables
with$rxModelVars
-
Simulation models from the UI now use
rxerr.endpoint
instead of
err.endpoint
for thesigma
residual error. This is to align
with the convention that internally generated variables start with
rx
ornlmixr
-
Sorting only uses timsort now, and was upgraded to the latest
version from Morwenn
Bug fixes
-
Simulating/solving from functions/ui now prefers params over
omega
andsigma
in the model (#632) -
Piping does not add constants to the initial estimates
-
When constants are specified in the
model({})
block (likek <- 1
), they will not
be to theini
block -
Bug fix for
geom_amt()
when theaes
transformation hasx
-
Bug fix for some covariate updates that may affect multiple compartment
models (like issue #581)
Maintenance fixes
- Modify plot code to work with development
xgxr
What's Changed
- Update pkgdown by @billdenney in #508
- export .matchesLangTemplate() by @billdenney in #516
- Add mu2 detection by @mattfidler in #524
- Add as.ini(NULL) which fixes ini(model) <- NULL by @mattfidler in #525
- Remove duplicate by @mattfidler in #529
- 531 when time is na a backdoor debugging is needed by @mattfidler in #532
- Extract model lines initial function by @mattfidler in #534
- S0521 patch 2 by @mattfidler in #540
- Create RxODEchs.po by @s0521 in #539
- Create R-RxODEchs.po by @s0521 in #538
- Link to info on symengine installation; spelling fixes by @billdenney in #541
- Fix and test for nse by @mattfidler in #545
- Fix/test $ by @mattfidler in #546
- Ss lag by @mattfidler in #492
- Add $iniDf and $meta to ui completion by @mattfidler in #557
- Nlmixr2 style by @mattfidler in #559
- 566 fix check with new rxode2parse by @mattfidler in #567
- 566 fix check with new rxode2parse by @mattfidler in #568
- Attempt to add by in confint and apply in plot() by @mattfidler in #570
- 577 allow confint to apply to means as well by @mattfidler in #578
- 579 plot for confint objects allows subsetting by @mattfidler in #580
- 581 rxode2 covariate sync by @mattfidler in #582
- 590 confint for binary probability by @mattfidler in #591
- 588 matexp fortran by @mattfidler in #589
- D theta by @mattfidler in #601
- Start testing udf by @mattfidler in #602
- Update exports by @mattfidler in #605
- 603 using $ini $inidf and model related lines for assignment by @mattfidler in #606
- Fix iCov by @mattfidler in #607
- 518 invalid off diagonal eta created with piping by @mattfidler in #608
- Add compile options text by @mattfidler in #611
- Add rxui control (and test for it too) by @mattfidler in #609
- 610 auto variable promotion in model piping append isnt working correctly by @mattfidler in #612
- 613 use character variable names in rxrename by @mattfidler in #614
- 552 feature request allow variables that are listscharacter vectors to be used in piping expressions by @mattfidler in #615
- Auto var piping option by @mattfidler in #616
- Adding more complex types (and testing) of model binding by @mattfidler in #618
- 619 allow initial parameters to be changed to covariate pop par or between subject variability with piping by @mattfidler in #621
- Add/test logical keep by @mattfidler in #623
- Test convert id issue by @mattfidler in #624
- 625 inconsistent append behavior between ini and model in model piping by @mattfidler in #626
- 627 remove labels in piping by @mattfidler in #628
- 629 mem issues by @mattfidler in #630
- Add modifying models article by @mattfidler in #620
New Contributors
Full Changelog: v2.0.14...v2.1.0