This uses RxODE family of objects, file, or model specification to solve a ODE system.
rxControl( scale = NULL, method = c("liblsoda", "lsoda", "dop853"), transitAbs = NULL, atol = 1e-08, rtol = 1e-06, maxsteps = 70000L, hmin = 0L, hmax = NA, hmaxSd = 0, hini = 0, maxordn = 12L, maxords = 5L, ..., cores, covsInterpolation = c("locf", "linear", "nocb", "midpoint"), addCov = FALSE, matrix = FALSE, sigma = NULL, sigmaDf = NULL, sigmaLower = -Inf, sigmaUpper = Inf, nCoresRV = 1L, sigmaIsChol = FALSE, nDisplayProgress = 10000L, amountUnits = NA_character_, timeUnits = "hours", stiff, theta = NULL, thetaLower = -Inf, thetaUpper = Inf, eta = NULL, addDosing = FALSE, stateTrim = Inf, updateObject = FALSE, omega = NULL, omegaDf = NULL, omegaIsChol = FALSE, omegaLower = -Inf, omegaUpper = Inf, nSub = 1L, thetaMat = NULL, thetaDf = NULL, thetaIsChol = FALSE, nStud = 1L, dfSub = 0, dfObs = 0, returnType = c("rxSolve", "matrix", "data.frame", "data.frame.TBS", "data.table", "tbl", "tibble"), seed = NULL, nsim = NULL, minSS = 10L, maxSS = 1000L, infSSstep = 12, strictSS = TRUE, params = NULL, events = NULL, istateReset = TRUE, subsetNonmem = TRUE, linLog = FALSE, maxAtolRtolFactor = 0.1, from = NULL, to = NULL, by = NULL, length.out = NULL, iCov = NULL, keep = NULL, drop = NULL, idFactor = TRUE, mxhnil = 0, hmxi = 0, warnIdSort = TRUE, warnDrop = TRUE, ssAtol = 1e-08, ssRtol = 1e-06, safeZero = TRUE ) rxSolve(object, ...) # S3 method for default rxSolve(object, params = NULL, events = NULL, inits = NULL, ...) # S3 method for rxSolve update(object, ...) # S3 method for RxODE predict(object, ...) # S3 method for rxSolve predict(object, ...) # S3 method for rxEt predict(object, ...) # S3 method for rxParams predict(object, ...) # S3 method for RxODE simulate(object, nsim = 1L, seed = NULL, ...) # S3 method for rxSolve simulate(object, nsim = 1L, seed = NULL, ...) # S3 method for rxParams simulate(object, nsim = 1L, seed = NULL, ...) # S3 method for rxSolve solve(a, b, ...) # S3 method for RxODE solve(a, b, ...) # S3 method for rxParams solve(a, b, ...) # S3 method for rxEt solve(a, b, ...)
a numeric named vector with scaling for ode
parameters of the system. The names must correspond to the
parameter identifiers in the ODE specification. Each of the
ODE variables will be divided by the scaling factor. For
The method for solving ODEs. Currently this supports:
boolean indicating if this is a transit compartment absorption
a numeric absolute tolerance (1e-8 by default) used by the ODE solver to determine if a good solution has been achieved; This is also used in the solved linear model to check if prior doses do not add anything to the solution.
a numeric relative tolerance (1e-6 by default) used by the ODE solver to determine if a good solution has been achieved. This is also used in the solved linear model to check if prior doses do not add anything to the solution.
maximum number of (internally defined) steps allowed during one call to the solver. (5000 by default)
The minimum absolute step size allowed. The default value is 0.
The maximum absolute step size allowed. When
The number of standard deviations of the time difference to add to hmax. The default is 0
The step size to be attempted on the first step. The default value is determined by the solver (when hini = 0)
The maximum order to be allowed for the nonstiff (Adams) method. The default is 12. It can be between 1 and 12.
The maximum order to be allowed for the stiff (BDF) method. The default value is 5. This can be between 1 and 5.
Other arguments including scaling factors for each compartment. This includes S# = numeric will scale a compartment # by a dividing the compartment amount by the scale factor, like NONMEM.
Number of cores used in parallel ODE solving. This
defaults to the number or system cores determined by
specifies the interpolation method for
time-varying covariates. When solving ODEs it often samples
times outside the sampling time specified in
A boolean indicating if covariates should be added to the output matrix or data frame. By default this is disabled.
A boolean indicating if a matrix should be returned instead of the RxODE's solved object.
Named sigma covariance or Cholesky decomposition of a covariance matrix. The names of the columns indicate parameters that are simulated. These are simulated for every observation in the solved system.
Degrees of freedom of the sigma t-distribution. By
default it is equivalent to
Lower bounds for simulated unexplained variability (by default -Inf)
Upper bounds for simulated unexplained variability (by default Inf)
Number of cores used for the simulation of the
sigma variables. By default this is 1. This uses the package
Boolean indicating if the sigma is in the Cholesky decomposition instead of a symmetric covariance
An integer indicating the minimum number of c-based solves before a progress bar is shown. By default this is 10,000.
This supplies the dose units of a data frame supplied instead of an event table. This is for importing the data as an RxODE event table.
This supplies the time units of a data frame supplied instead of an event table. This is for importing the data as an RxODE event table.
a logical (
For stiff ODE systems (
For non-stiff systems (
A vector of parameters that will be named THETA[#] and added to parameters
Lower bounds for simulated population parameter variability (by default -Inf)
Upper bounds for simulated population unexplained variability (by default Inf)
A vector of parameters that will be named ETA[#] and added to parameters
Boolean indicating if the solve should add RxODE
EVID and related columns. This will also include dosing
information and estimates at the doses. Be default, RxODE
only includes estimates at the observations. (default
When amounts/concentrations in one of the states are above this value, trim them to be this value. By default Inf. Also trims to -stateTrim for large negative amounts/concentrations. If you want to trim between a range say `c(0, 2000000)` you may specify 2 values with a lower and upper range to make sure all state values are in the reasonable range.
This is an internally used flag to update the
RxODE solved object (when supplying an RxODE solved object) as
well as returning a new object. You probably should not
Estimate of Covariance matrix. When omega is a list, assume it is a block matrix and convert it to a full matrix for simulations.
The degrees of freedom of a t-distribution for
simulation. By default this is
Indicates if the
Lower bounds for simulated ETAs (by default -Inf)
Upper bounds for simulated ETAs (by default Inf)
Number between subject variabilities (ETAs) simulated for every realization of the parameters.
Named theta matrix.
The degrees of freedom of a t-distribution for
simulation. By default this is
Indicates if the
Number virtual studies to characterize uncertainty in estimated parameters.
Degrees of freedom to sample the between subject variability matrix from the inverse Wishart distribution (scaled) or scaled inverse chi squared distribution.
Degrees of freedom to sample the unexplained variability matrix from the inverse Wishart distribution (scaled) or scaled inverse chi squared distribution.
This tells what type of object is returned. The currently supported types are:
an object specifying if and how the random number generator should be initialized
represents the number of simulations. For RxODE, if you supply single subject event tables (created with eventTable)
Minimum number of iterations for a steady-state dose
Maximum number of iterations for a steady-state dose
Step size for determining if a constant infusion has reached steady state. By default this is large value, 420.
Boolean indicating if a strict steady-state is
required. If a strict steady-state is (
a numeric named vector with values for every parameter in the ODE system; the names must correspond to the parameter identifiers used in the ODE specification;
subset to NONMEM compatible EVIDs only. By default TRUE.
Boolean indicating if linear compartment models be
calculated more accurately in the log-space (slower) By
default this is off (
When there is no observations in the event table, start observations at this value. By default this is zero.
When there is no observations in the event table, end observations at this value. By default this is 24 + maximum dose time.
When there are no observations in the event table, this
is the amount to increment for the observations between
The number of observations to create if there isn't any observations in the event table. By default this is 200.
A data frame of individual non-time varying covariates
to combine with the
Columns to keep from either the input dataset or the
Columns to drop from the output
This boolean indicates if original ID values should be maintained. This changes the default sequentially ordered ID to a factor with the original ID values in the original dataset. By default this is enabled.
maximum number of messages printed (per problem) warning that T + H = T on a step (H = step size). This must be positive to result in a non-default value. The default value is 0 (or infinite).
inverse of the maximum absolute value of H to be used. hmxi = 0.0 is allowed and corresponds to an infinite hmax (default). hmin and hmxi may be changed at any time, but will not take effect until the next change of H is considered. This option is only considered with method=liblsoda.
Warn if the ID is not present and RxODE assumes the order of the parameters/iCov are the same as the order of the parameters in the input dataset.
Warn if column(s) were supposed to be dropped, but were not present.
Steady state atol convergence factor. Can be a vector based on each state.
Steady state rtol convergence factor. Can be a vector based on each state.
Use safe zero divide and log routines. By default this is turned on but you may turn it off if you wish.
is a either a RxODE family of objects, or a file-name with a RxODE model specification, or a string with a RxODE model specification.
a vector of initial values of the state variables (e.g., amounts in each compartment), and the order in this vector must be the same as the state variables (e.g., PK/PD compartments);
An “rxSolve” solve object that stores the solved value in a matrix with as many rows as there are sampled time points and as many columns as system variables (as defined by the ODEs and additional assignments in the RxODE model code). It also stores information about the call to allow dynamic updating of the solved object.
The operations for the object are similar to a data-frame, but
[[""]] access operators and
assignment operators to resolve based on different parameter
values, initial conditions, solver parameters, or events (by
You can call the
eventTable methods on the solved
object to update the event table and resolve the system of
Hindmarsh, A. C. ODEPACK, A Systematized Collection of ODE Solvers. Scientific Computing, R. S. Stepleman et al. (Eds.), North-Holland, Amsterdam, 1983, pp. 55-64.
Petzold, L. R. Automatic Selection of Methods for Solving Stiff and Nonstiff Systems of Ordinary Differential Equations. Siam J. Sci. Stat. Comput. 4 (1983), pp. 136-148.
Hairer, E., Norsett, S. P., and Wanner, G. Solving ordinary differential equations I, nonstiff problems. 2nd edition, Springer Series in Computational Mathematics, Springer-Verlag (1993).