View source: R/rxMemoryEstimate.R
| rxMemoryEstimate | R Documentation |
Accepts either a pre-summarized per-ID table (an rxMemSummary
or any data.frame with nobs and ndoses columns) or a full
event-table data.frame with an evid column. Model dimensions can
be supplied via a compiled rxode2 model object or overridden individually.
rxMemoryEstimate(
dat,
model = NULL,
control = NULL,
neq = 1L,
stateSize = neq,
nlhs = 0L,
npars = neq,
neta = 0L,
neps = 0L,
ncov = 0L,
nsim = 1L,
cores = 1L,
nMtime = 0L,
extraCmt = 0L,
linB = FALSE,
nLlik = 0L,
nIndSim = NULL,
numLinSens = 0L,
numLin = 0L
)
dat |
A |
model |
Optional rxode2 model object. When supplied,
|
control |
Optional |
neq |
Number of ODE states. |
stateSize |
Effective |
nlhs |
Number of LHS (calculated) output variables. |
npars |
Number of model parameters (drives |
neta |
Number of random effects (etas). |
neps |
Number of residual-error levels (epsilons). |
ncov |
Number of time-varying covariates. |
nsim |
Number of simulations. |
cores |
Number of parallel OMP threads. |
nMtime |
Number of model measurement times. |
extraCmt |
Extra compartments (0, 1 = depot, 2 = depot+central). |
linB |
|
nLlik |
Number of log-likelihood terms (FOCEi use). |
nIndSim |
Per-individual simulation count. Defaults to
|
numLinSens |
Number of linear sensitivity parameters (FOCEi + linCmt). |
numLin |
Number of linear compartment terms (FOCEi + linCmt). |
The byte counts are computed by rxMemoryComponents_() which calls
the same rxFillMemLayout() used by the real allocator, so any
change to the allocation formulas propagates here automatically.
A named list of class "rxMemoryEstimate" whose
elements are raw byte counts plus outputData,
ramBytes, freeRamBytes, total,
sizeofInd, and rxLlikSaveSize.
mod <- rxode2::rxode2({
d/dt(depot) <- -ka * depot
d/dt(center) <- ka * depot - cl / v * center
cp <- center / v
})
ev <- rxode2::et(amt = 100, ii = 24, until = 168) |>
rxode2::et(seq(0, 168, by = 1))
# Basic estimate from event table and model
rxMemoryEstimate(as.data.frame(ev), model = mod)
# With rxControl: population simulation with omega and 4 cores
ctrl <- rxode2::rxControl(
cores = 4L,
omega = lotri::lotri(eta.ka ~ 0.09, eta.cl ~ 0.04)
)
rxMemoryEstimate(as.data.frame(ev), model = mod, control = ctrl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.