Learn R Programming

epigrowthfit (version 0.15.4)

egf_control: Define Control Parameters

Description

Set parameters controlling the behaviour of egf.

Usage

egf_control(outer_optimizer = egf_optimizer(nlminb),
            inner_optimizer = egf_optimizer(newton),
            trace = FALSE, profile = FALSE, sparse_X = FALSE,
            omp_num_threads = getOption("egf.cores", 1L))

Value

A list inheriting from class egf_control containing the validated arguments.

Arguments

outer_optimizer, inner_optimizer

egf_optimizer objects specifying “outer” and “inner” optimization methods.

trace

an integer determining the amount of tracing performed; see ‘Details’.

profile

a logical. If TRUE, then fixed effect coefficients are profiled out of the likelihood, which may stabilize optimization for models with many fixed effects. This “feature” should be considered experimental, and in fact it may destabilize optimization, as it relies on assumptions about the optimization problem that are not necessarily satisfied by the nonlinear mixed effects models fit by egf.

sparse_X

a logical. If TRUE, then the fixed effects design matrix is represented as a (sparse) dgCMatrix, rather than as a traditional (dense) matrix.

omp_num_threads

an integer indicating a number of OpenMP threads to be used when evaluating the objective function, provided that epigrowthfit was compiled with OpenMP support.

Warning

Setting trace > 0L and omp_num_threads > 0L simultaneously should be avoided, because tracing messages are printed using R API functions that are not thread-safe.

Details

trace affects the amount of information printed during likelihood evaluations:

0

likelihood evaluations are always silent.

1

a message is printed whenever a negative log marginal likelihood term is NaN or exceeds 1e+09.

2

all negative log marginal likelihood terms are printed.

egf passes silent = trace == 0L to MakeADFun. A corollary is that nonzero values of trace have a number of additional side effects:

  • error messages are printed during function and gradient evaluations;

  • the maximum absolute gradient element is printed with each gradient evaluation; and

  • trace flags set by config are turned on.

Examples

Run this code
control <- egf_control()
str(control)

Run the code above in your browser using DataLab