Skip to content

Releases: nlmixr2/rxode2

v3.0.1

26 Sep 03:09
Compare
Choose a tag to compare

rxode2 3.0.1

  • Explicitly initialize the order vector to stop valgrind warning
    (requested from CRAN)

Full Changelog: v3.0.0...v3.0.1

v3.0.0

18 Sep 14:26
Compare
Choose a tag to compare

rxode2 3.0.0

Breaking Changes

  • The model properties was moved from $params to $props so it does
    not conflict with the low level rxode2 model $params

  • Error when specifying wd without modName

  • With Linear and midpoint of a time between two points, how rxode2
    handles missing values has changed. When the missing value is lower
    than the requested time, it will look backward until it finds the
    first non-missing value (or if all are missing start looking
    forward). When the missing value is higher than the requested time,
    the algorithm will look forward until it finds the first non-missing
    value (or if all are missing, start looking backward).

  • The order of ODEs is now only determined by the order of cmt() and
    d/dt(). Compartment properties, tad() and other compartment
    related variables no no longer affect compartment sorting. The
    option rxode2.syntax.require.ode.first no longer does anything.

  • The handling of zeros "safely" has changed (see #775)

    • when safeZero=TRUE and the denominator of a division expression
      is zero, use the Machine's small number/eps (you can see this
      value with .Machine$double.eps)

    • when saveLog=TRUE and the x in the log(x) is less than or
      equal to zero, change this to log(eps)

    • when safePow=TRUE and the expression x^y has a zero for x
      and a negative number for y replace x with eps.

    Since the protection for divide by zero has changed, the results
    will also change. This is a more conservative protection mechanism
    than was applied previously.

  • Random numbers from rxode2 are different when using dop853,
    lsoda or indLin methods. These now seed the random numbers in
    the same way as liblsoda, so the random number provided will be
    the same with different solving methods.

  • The arguments saved in the rxSolve for items like thetaMat will
    be the reduced matrices used in solving, not the full matrices (this
    will likely not break very many items)

Possible breaking changes (though unlikely)

  • iCov is no longer merged to the event dataset. This makes solving
    with iCov slightly faster (#743)

New features

  • You can remove covariances for every omega by piping with %>% ini(diag()) you can be a bit more granular by removing all
    covariances that have either eta.ka or eta.cl by: %>% ini(diag(eta.ka, eta.cl)) or anything with correlations with
    eta.cl with %>% ini(diag(eta.cl))

  • You can also remove individual covariances by %>% ini(-cov(a, b))
    or %>% ini(-cor(a,b)).

  • You can specify the type of interpolation applied for added dosing
    records (or other added records) for columns that are kept with the
    keep= option in rxSolve(). This new option is
    keepInterpolation and can be locf for last observation carried
    forward, nocb which is the next observation carried backward, as
    well as NA which puts a NA in all imputed data rows. See #756.

    • Note: when interpolation is linear/midpoint for
      factors/characters it changes to locf with a warning (#759)

    • Also note, that the default keep interpolation is na

  • Now you can specify the interpolation method per covariate in the model:

    • linear(var1, var2) says both var1 and var2 would use linear
      interpolation when they are a time-varying covariate. You could
      also use linear(var1)

    • locf() declares variables using last observation carried forward

    • nocb() declares variables using next observation carried backward

    • midpoint() declares variables using midpoint interpolation

  • linear(), locf(), locb(), midpoint(), params(), cmt()
    and dvid() declarations are now ignored when loading a rxode2
    model with rxS()

  • Strings can be assigned to variables in rxode2.

  • Strings can now be enclosed with a single quote as well as a double
    quote. This limitation was only in the rxode2 using string since
    the R-parser changes single quotes to double quotes. (This has no
    impact with rxode2({}) and ui/function form).

  • More robust string encoding for symengine (adapted from
    utils::URLencode() and utils::URLdecode())

  • Empty arguments to rxRename() give a warning (#688)

  • Promoting from covariates to parameters with model piping (via ini()) now
    allows setting bounds (#692)

  • Added assertCompartmentName(), assertCompartmentExists(),
    assertCompartmentNew(), testCompartmentExists(),
    assertVariableExists() testVariableExists(),
    assertVariableNew(), assertVariableName(), and
    assertParameterValue() to verify that a value is a valid nlmixr2
    compartment name, nlmixr2 compartment/variable exists in the model,
    variable name, or parameter value (#726; #733)

  • Added assertRxUnbounded(), testRxUnbounded(), warnRxBounded()
    to allow nlmixr2 warn about methods that ignore boundaries #760

  • Added functions tad0(), tafd0(), tlast0() and tfirst0() that
    will give 0 instead of NA when the dose has not been
    administered yet. This is useful for use in ODEs since NAs will
    break the solving (so can be used a bit more robustly with models
    like Weibull absorption).

  • rxode2 is has no more binary link to lotri, which means that
    changes in the lotri package will not require rxode2 to be
    recompiled (in most cases) and will not crash the system.

  • rxode2 also has no more binary linkage to PreciseSums

  • The binary linkage for dparser is reduced to C structures only,
    making changes in dparser less likely to cause segmentation faults
    in rxode2 if it wasn't recompiled.

  • A new model property has been added to $props$cmtProp and
    $statePropDf. Both are data-frames showing which compartment has
    properties (currently ini, f, alag, rate and dur)
    in the rxode2 ui model. This comes from the lower
    level model variable $stateProp which has this information
    encoded in integers for each state.

  • A new generic method rxUiDeparse can be used to deparse meta
    information into more readable expressions; This currently by
    default supports lower triangular matrices by lotri, but can be
    extended to support other types of objects like 'nlmixr2's
    foceiControl() for instance.

Bug fixes

  • Fix ui$props$endpoint when the ui endpoint is defined in terms of
    the ode instead of lhs. See #754

  • Fix ui$props when the ui is a linear compartment model without ka defined.

  • Model extraction modelExtract() will now extract model properties. Note that the model property of alag(cmt) and lag(cmt) will give the same value. See #745

  • When assigning reserved variables, the parser will error. See #744

  • Linear interpolation will now adjust the times as well as the values
    when NA values are observed.

  • Fix when keeping data has NA values that it will not crash R; Also
    fixed some incorrect NA interpolations. See #756

  • When using cmt() sometimes the next statement would be corrupted
    in the normalized syntax (like for instance locf); This bug was
    fixed (#763)

  • keep will now error when trying to keep items that are in the
    rxode2 output data-frame and will be calculated (#764)

Big change

  • At the request of CRAN, combine rxode2parse, rxode2random, and
    rxode2et into this package; The changes in each of the packages are
    now placed here:

rxode2et (no changes before merge)

rxode2et 2.0.13

  • Fix import of data where there are NA times

rxode2et 2.0.12

  • Fix formatting issues identified by m1mac, as requested by CRAN

rxode2et 2.0.11

  • Make the stacking more flexible to help rxode2 have more types of plots

  • Add toTrialDuration by Omar Elashkar to convert event data to trial duration data

  • Fix Issue #23 and prefer variable values over NSE values

rxode2et 2.0.10

  • Fix dollar sign accessing of objects (like data frames), as pointed
    out by @frbrz (issue #16)

  • Use rxode2parse functions for internal event table creation (where
    they were moved to).

  • Dropped C++14 and let the system decide.

rxode2et 2.0.9

  • Split off et(), eventTable() and related functions.

  • Also split off rxStack() and rxCbindStudyIndividual() in this
    package.

  • Added a NEWS.md file to track changes to the package.

rxode2random (before merge)

  • Fix a bug when simulating nested variables (#25)

rxode2random 2.1.0

  • Breaking Change changed distributions from the standard C++
    <random> to boost::random. Since this is not dependent on the
    compiler, it makes the random numbers generated from Mac, Windows
    and Linux the same for every distribution. Unfortunately with a new
    random number transformation, the simulation results will likely be
    different than they were before. The exception to this is the
    uniform number, which was always the same between platforms.

rxode2random 2.0.13

  • Fixed formatting issues (as requested by CRAN and identified on m1mac)

rxode2random 2.0.12

  • Added function dfWishart which gives (by simulation) an
    approximation of the degrees of freedom of a Wishart to match a
    rse value.

  • Added function swapMatListWithCube which swaps omegaList with
    omegaCube values

  • Ensure that the outputs are integers (instead of long integers) as
    requested by CRAN for some checking functions.

rxode2random 2.0.11

  • Fix qassert LTO

rxode2random 2.0.10

  • Moved fast factor to rxode2parse to allow etTrans to be moved there

rxode2random 2.0.9

  • Initial release of rxode2random, which separates the parallel
    safe, random number generation from 'rxode2' into a separate package to
    reduce 'rxode2' compilation time. Th...
Read more

v2.1.3

28 May 09:52
6cfbaac
Compare
Choose a tag to compare

rxode2 2.1.3

Bug fixes

  • Make sure that the object is a uncompressed rxode2 ui for solving with rxSolve (See #661)

  • Fix #670 by using the last simulated observation residual when there
    are trailing doses.

New features

  • Create a function to see if a rxode2 solve is loaded in memory
    (rxode2::rxSolveSetup())

  • Create a new function that fixes the rxode2 population values in the
    model (and drops them in the initial estimates); rxFixPop()

Other changes

  • Pendantic no-remap (as requested by CRAN)

  • gcc USBAN fix (as requested by CRAN)

What's Changed

Full Changelog: v2.1.2...v2.1.3

v2.1.2

31 Jan 02:24
ba49bcc
Compare
Choose a tag to compare

rxode2 2.1.2

Other changes

  • rxUi compression now defaults to fast compression

  • Fixes String literal formatting issues as identified by CRAN (#643)

  • Removes linear compartment solutions with gradients for intel c++
    compiler (since they crash the compiler).

What's Changed

Full Changelog: v2.1.0...v2.1.2

v2.1.0

11 Dec 23:55
2878bf8
Compare
Choose a tag to compare

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 the rxControl() 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 with rxFun() (you can see the
    C code afterwards with rxC("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 with rxS()

  • When plotting and creating confidence intervals for multiple
    endpoint models simulated from a rxode2 ui model, you can
    plot/summarize each endpoint with sim. (ie. confint(model, "sim") or plot(model, sim)).

    If you only want to summarize a subset of endpoints, you can focus
    on the endpoint by pre-pending the endpoint with sim. For example
    if you wanted to plot/summarize only the endpoint eff you would
    use sim.eff. (ie confint(model, "sim.eff") or plot(model, sim.eff))

  • Added model$simulationIniModel which prepend the initial
    conditions in the ini({}) block to the classic rxode2({}) model.

  • Now model$simulationModel and model$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 and as.ini(NULL)
    gives ini({}) (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 with model(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 use by 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 use ci=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 with levels but use
    your own ci=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 use mean=TRUE to use the mean for the first level of
    confidence using meanProbs(). For this confidence interval you can
    override the n used in the confidence interval by using n=#. 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 use mean="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 using n=#. You can also
    change this to a prediction interval instead using pred=TRUE. With
    pred=TRUE you can override the number of predicted samples with
    m=#

  • When plotting the confint derived intervals from an rxode2
    simulation, you can now subset based on a simulated value like
    plot(ci, Cc) which will only plot the variable Cc that you
    summarized even if you also summarized eff (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 to ini(model) <- and model(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, use lotri 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 without ini() blocks (#617 / #573
    / #575).

  • keep will now also keep attributes of the input data (with special
    handling for levels); 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 for ini() and model() have been
    aligned to perform similarly. Therefore ini(append=) now can take
    expressions instead of simply strings and model(append=) can also
    take strings. Also model piping now can specify the integer line
    number to be modified just like the ini() could. Also
    model(append=FALSE) has been changed to model(append=NULL).
    While the behavior is the same when you don't specify the argument,
    the behavior has changed to align with ini() when piping. Hence
    model(append=TRUE) will append and model(append=FALSE) will now
    pre-pend to the model. model(append=NULL) will modify lines like
    the behavior of ini(append=NULL). The default of model(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 idiom model(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 implies model(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 the sigma residual error. This is to align
    with the convention that internally generated variables start with
    rx or nlmixr

  • 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
    and sigma in the model (#632)

  • Piping does not add constants to the initial estimates

  • When constants are specified in the model({}) block (like k <- 1), they will not
    be to the ini block

  • Bug fix for geom_amt() when the aes transformation has x

  • 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

Read more

v2.0.14

08 Oct 02:46
597c7d0
Compare
Choose a tag to compare

rxode2 2.0.14

  • CRAN requested that FORTRAN kind be changed as it was not portable;
    This was commented code, and simply removed the comment.

  • Bug-fix for geom_amt(); also now uses linewidth and at least ggplot2 3.4.0

  • Some documentation was cleaned up from rxode2 2.0.13

Full Changelog: v2.0.13...v2.0.14

v2.0.13

22 Apr 18:57
ca820ac
Compare
Choose a tag to compare
  • A bug was fixed so that the zeroRe() function works with correlated omega
    values.

  • A bug was fixed so that the rename() function works with initial
    conditions for compartments (cmt(0))

What's Changed

Full Changelog: v2.0.12...v2.0.13

v2.0.12

28 Mar 13:21
df01bca
Compare
Choose a tag to compare

rxode2 2.0.12

New features

  • A new function zeroRe() allows simple setting of omega and/or sigma values
    to zero for a model (#456)

  • Diagonal zeros in the omega and sigma matrices are treated as
    zeros in the model. The corresponding omega and sigma matrices
    drop columns/rows where the diagonals are zero to create a new
    omega and sigma matrix for simulation. This is the same idiom
    that NONMEM uses for simulation from these matrices.

  • Add the ability to pipe model estimates from another model by
    parentModel %>% ini(modelWithNewEsts)

  • Add the ability to append model statements with piping using %>% model(x=3, append=d/dt(depot)), still supports appending with
    append=TRUE and pre-pending with append=NA (the default is to
    replace lines with append=FALSE)

  • rxSolve's keep argument will now maintain character and factor classes from
    input data with the same class (#190)

  • Parameter labels may now be modified via ini(param = label("text")) (#351).

  • Parameter order may be modified via the append argument to ini()
    when piping a model. For example, ini(param = 1, append = 0) or
    ini(param = label("text"), append = "param2") (#352).

Internal changes

  • If lower/upper bounds are outside the required bounds, the
    adjustment is displayed.

  • When initial values are piped that break the model's boundary
    condition reset the boundary to unbounded and message which boundary
    was reset.

  • Added as.rxUi() function to convert the following objects to
    rxUi objects: rxode2, rxModelVars, function. Converting
    nlmixr2 fits to rxUi will be placed in the s3 method in the
    corresponding package.

  • assertRxUi(x) now uses as.rxUi() so that it can be extended
    outside of rxode2/nlmixr2.

  • rxode2 now supports addl with ss doses

  • Moved rxDerived to rxode2parse (and re-exported it here).

  • Added test for transit compartment solving in absence of dosing to the
    transit compartment (fixed in rxode2parse but solving tested
    here)

  • Using ini() without any arguments on a rxode2 type function will
    return the ini() block. Also added a method ini(mod) <- iniBlock to modify the ini block is you wish. iniBlock should
    be an expression.

  • Using model() without any arguments on a rxode2 type function
    will return the model() block. Also added a new method
    model(mod) <- modelBlock

  • Added a new method rxode2(mod) <- modFunction which allows
    replacing the function with a new function while maintaining the
    meta information about the ui (like information that comes from
    nonmem2rx models). The modFunction should be the body of the
    new function, the new function, or a new rxode2 ui.

  • rxode2 ui objects now have a $sticky item inside the internal
    (compressed) environment. This $sticky tells what variables to
    keep if there is a "significant" change in the ui during piping or
    other sort of model change. This is respected during model piping,
    or modifying the model with ini(mod)<-, model(mod)<-,
    rxode2(mod)<-. A significant change is a change in the model
    block, a change in the number of estimates, or a change to the value
    of the estimates. Estimate bounds, weather an estimate is fixed or
    estimate label changes are not considered significant.

  • Added as.ini() method to convert various formats to an ini
    expression. It is used internally with ini(mod)<-. If you want to
    assign something new that you can convert to an ini expression, add
    a method for as.ini().

  • Added as.model() method to convert various formats to a model
    expression. It is used internally with model(mod)<-. If you want to
    assign something new that you can convert to a model expression, add
    a method for as.model().

What's Changed

New Contributors

Full Changelog: v2.0.11...v2.0.12

v2.0.11

02 Nov 11:31
c9d146e
Compare
Choose a tag to compare

rxode2 2.0.11

Give a more meaningful error for 'rxode2' ui models with only error expressions

Break the ABI requirement between roxde2() and rxode2parse()

The new rxode2parse will fix the sprintf exclusion shown on CRAN.

What's Changed

Full Changelog: v2.0.10...v2.0.11

v2.0.10

21 Oct 01:43
dd4da42
Compare
Choose a tag to compare

rxode2 2.0.10

  • Time invariant covariates can now contain 'NA' values.

  • When a column has 'NA' for the entire id, now 'rxode2' warns about
    both the id and column instead of just the id.

  • To fix some CRAN issues in 'nlmixr2est', make the version dependency
    explicit.