saemControl: Control Options for SAEM

View source: R/nlmixr.R

saemControlR Documentation

Control Options for SAEM

Description

Control Options for SAEM

Usage

saemControl(
  seed = 99,
  nBurn = 200,
  nEm = 300,
  nmc = 3,
  nu = c(2, 2, 2),
  atol = 1e-06,
  rtol = 1e-04,
  method = "liblsoda",
  transitAbs = FALSE,
  print = 1,
  trace = 0,
  covMethod = c("linFim", "fim", "r,s", "r", "s", ""),
  calcTables = TRUE,
  logLik = FALSE,
  nnodes.gq = 3,
  nsd.gq = 1.6,
  optExpression = FALSE,
  maxsteps = 100000L,
  adjObf = TRUE,
  sum.prod = FALSE,
  addProp = c("combined2", "combined1"),
  singleOde = TRUE,
  tol = 1e-06,
  itmax = 30,
  type = c("nelder-mead", "newuoa"),
  powRange = 10,
  lambdaRange = 3,
  loadSymengine = FALSE,
  odeRecalcFactor = 10^(0.5),
  maxOdeRecalc = 5L,
  ...
)

Arguments

seed

Random Seed for SAEM step. (Needs to be set for reproducibility.) By default this is 99.

nBurn

Number of iterations in the Stochastic Approximation (SA), or burn-in step. This is equivalent to Monolix's K_0 or K_b.

nEm

Number of iterations in the Expectation-Maximization (EM) Step. This is equivalent to Monolix's K_1.

nmc

Number of Markov Chains. By default this is 3. When you increase the number of chains the numerical integration by MC method will be more accurate at the cost of more computation. In Monolix this is equivalent to L

nu

This is a vector of 3 integers. They represent the numbers of transitions of the three different kernels used in the Hasting-Metropolis algorithm. The default value is c(2,2,2), representing 40 for each transition initially (each value is multiplied by 20).

The first value represents the initial number of multi-variate Gibbs samples are taken from a normal distribution.

The second value represents the number of uni-variate, or multi- dimensional random walk Gibbs samples are taken.

The third value represents the number of bootstrap/reshuffling or uni-dimensional random samples are taken.

atol

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.

rtol

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.

method

The method for solving ODEs. Currently this supports:

  • "liblsoda" thread safe lsoda. This supports parallel thread-based solving, and ignores user Jacobian specification.

  • "lsoda" – LSODA solver. Does not support parallel thread-based solving, but allows user Jacobian specification.

  • "dop853" – DOP853 solver. Does not support parallel thread-based solving nor user Jacobain specification

  • "indLin" – Solving through inductive linearization. The RxODE dll must be setup specially to use this solving routine.

transitAbs

boolean indicating if this is a transit compartment absorption

print

The number it iterations that are completed before anything is printed to the console. By default, this is 1.

trace

An integer indicating if you want to trace(1) the SAEM algorithm process. Useful for debugging, but not for typical fitting.

covMethod

Method for calculating covariance. In this discussion, R is the Hessian matrix of the objective function. The S matrix is the sum of each individual's gradient cross-product (evaluated at the individual empirical Bayes estimates).

"linFim" Use the Linearized Fisher Information Matrix to calculate the covariance.

"fim" Use the SAEM-calculated Fisher Information Matrix to calculate the covariance.

"r,s" Uses the sandwich matrix to calculate the covariance, that is: R^-1 \times S \times R^-1

"r" Uses the Hessian matrix to calculate the covariance as 2\times R^-1

"s" Uses the crossproduct matrix to calculate the covariance as 4\times S^-1

"" Does not calculate the covariance step.

calcTables

This boolean is to determine if the foceiFit will calculate tables. By default this is TRUE

logLik

boolean indicating that log-likelihood should be calculate by Gaussian quadrature.

nnodes.gq

number of nodes to use for the Gaussian quadrature when computing the likelihood with this method (defaults to 1, equivalent to the Laplaclian likelihood)

nsd.gq

span (in SD) over which to integrate when computing the likelihood by Gaussian quadrature. Defaults to 3 (eg 3 times the SD)

optExpression

Optimize the RxODE expression to speed up calculation. By default this is turned on.

maxsteps

maximum number of (internally defined) steps allowed during one call to the solver. (5000 by default)

adjObf

is a boolean to indicate if the objective function should be adjusted to be closer to NONMEM's default objective function. By default this is TRUE

sum.prod

Take the RxODE model and use more precise products/sums. Increases solving accuracy and solving time.

addProp

one of "combined1" and "combined2"; These are the two forms of additive+proportional errors supported by monolix/nonmem:

combined1: transform(y)=transform(f)+(a+b*f^c)*eps

combined2: transform(y)=transform(f)+(a^2+b^2*f^(2c))*eps

singleOde

This option allows a single ode model to include the PK parameter information instead of splitting it into a function and a RxODE model

tol

This is the tolerance for the regression models used for complex residual errors (ie add+prop etc)

itmax

This is the maximum number of iterations for the regression models used for complex residual errors. The number of iterations is itmax*number of parameters

type

indicates the type of optimization for the residuals; Can be one of c("nelder-mead", "newuoa")

powRange

This indicates the range that powers can take for residual errors; By default this is 10 indicating the range is c(1/10, 10) or c(0.1,10)

lambdaRange

This indicates the range that Box-Cox and Yeo-Johnson parameters are constrained to be; The default is 3 indicating the range (-3,3)

loadSymengine

Boolean indicating if the model should be loaded into symengine. This cause all the ODEs to be collapsed into one expression that is eventually optimized if optExpression is TRUE.

odeRecalcFactor

The factor to increase the rtol/atol with bad ODE solving.

maxOdeRecalc

Maximum number of times to reduce the ODE tolerances and try to resolve the system if there was a bad ODE solve.

...

Other arguments to control SAEM.

Value

List of options to be used in nlmixr fit for SAEM.

Author(s)

Wenping Wang & Matthew L. Fidler


nlmixr documentation built on March 27, 2022, 5:05 p.m.

Related to saemControl in nlmixr...