View source: R/FUN_model_interface.R
| mmes_control | R Documentation |
Creates the validated object passed to the control argument of
mmes. It collects every numerical choice of a fit:
the equation formulation, the linear solvers, covariance updates,
convergence, output, memory/threads and diagnostics. Statistical choices
(REML vs ML, exact vs Laplace vs PQL integration, fit vs solve) do not belong
here; they are declared in mmes_method. Starting values for
nonlinear parameters are given in mmes(start=) and family nuisance
parameters in mmes(familyParameters=).
Each argument is a module and is given as a named list; only the fields you
supply are changed and all others keep their defaults. For example,
mmes_control(solve=list(method="pcg", tol=1e-6), execution=list(seed=1)).
Unknown modules or fields, invalid values, and combinations that are not
mathematically admissible (for example PCG fields without
solve$method="pcg") stop with an informative error that names the
offending fields. A request can also be valid on its own but ineligible for
the model being fitted; mmes then stops rather than silently changing
the algorithm. The defaults reproduce the established sommer algorithm, so
mmes_control() is the right choice for most analyses.
mmes_control(formulation = "henderson", optimizer = list(), mode = list(),
working = list(), likelihood = list(), population = list(),
inference = list(), representation = list(), solve = list(),
logdet = list(), score = list(), curvature = list(), update = list(),
proposal = list(), convergence = list(), output = list(),
execution = list(), diagnostics = list())
formulation |
A single string selecting the equation domain.
The factorization backend is chosen separately in |
optimizer |
Outer optimizer for nonlinear-parameter and native Laplace likelihood fits (Gaussian covariance engines use the AI/update modules below instead). Fields:
|
mode |
Conditional random-effect mode search used by Laplace and nonlinear fits (not by Gaussian or PQL working fits). Fields:
|
working |
Outer iterations of the penalized quasi-likelihood (PQL)
working fit used for non-Gaussian mixed models by default. Fields:
|
likelihood |
Algebra used by the native Laplace likelihood (see
|
population |
Gauss quadrature for response-scale population
predictions of nonlinear models. Fields: |
inference |
Post-fit numerical uncertainty for nonlinear models.
Fields: |
representation |
How equations and covariance operators are represented. Fields:
|
solve |
Linear solves and exact eliminations. Fields:
|
logdet |
Log-determinant approximation used by PCG. Fields:
|
score |
Covariance-parameter derivatives and trace estimation.
Fields: |
curvature |
Information matrix used by the optimizer. |
update |
How covariance parameters are updated. |
proposal |
Scaling of proposed steps. |
convergence |
Inner iterations and stopping rules. Fields:
|
output |
What is computed after the fit. Fields:
|
execution |
Resources and reproducibility. Fields:
|
diagnostics |
Messages and profiling. Fields: |
Switch-like fields. Fields documented as "auto", "off",
"force" also accept TRUE (force) and FALSE (off).
"auto" lets sommer use the option when the model is eligible, while
"force" requests it and errors if it is not admissible. A forced
request never bypasses mathematical, structural or memory checks.
Global options. Experimental-mode defaults, the memory budget and
GPU settings can be set through R options, e.g.
options(sommer.mme.denseMemoryMB=2000). Values given explicitly in
mmes_control() always override option-derived defaults, so use them
for reproducible analyses.
Common recipes.
Quiet fit: mmes_control(diagnostics=list(verbose=FALSE)).
More iterations: mmes_control(convergence=list(maxIters=100)).
Random-effect PEVs at fit time: mmes_control(output=list(inverse=1));
or leave inverse=0 and call postPEV.
Skip standard errors of variance components for speed:
mmes_control(output=list(covariance="none")).
Very large sparse system:
mmes_control(solve=list(method="pcg"), execution=list(seed=1)).
Rank-deficient fixed design:
mmes_control(representation=list(fixedRank="drop")).
Inspect the model without fitting:
mmes_control(output=list(setup=TRUE)).
Limit threads and memory:
mmes_control(execution=list(blasThreads=2, denseMemoryMB=500)).
Migration. Numerical arguments removed from mmes() are now
fields of the modules above, e.g. henderson is
formulation, solver is solve$method, nIters is
convergence$maxIters, tolParConvLL and tolParConvNorm
are convergence$likelihoodTol and convergence$parameterTol,
tolParInv is execution$inverseTol, computeCi is
output$inverse, returnParam is output$setup,
pqlControl is working, and verbose/dateWarning
are diagnostics fields. REML and solveOnly moved to
mmes_method. The complete table is in the
sommer.mmes.options vignette.
A list of class sommer_mmes_control with one element per module.
It is validated again by mmes() and stored in the fitted object as
fit$control. mmes() accepts only objects created by this
function.
Covarrubias-Pazaran G. Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 2016, 11(6): doi:10.1371/journal.pone.0156744
Gilmour et al. 1995. Average Information REML: An efficient algorithm for variance parameter estimation in linear mixed models. Biometrics 51(4):1440-1450.
mmes, mmes_method, postPEV,
vcc, profile_nonlinear; the vignette
vignette("sommer.mmes.options") for the full field reference, defaults,
eligibility rules and decision graph, and vignette("sommer.machinery")
for the engine.
dat <- data.frame(x=seq_len(12), y=1+seq_len(12)/2+sin(seq_len(12))/10)
## defaults, silenced
ctl <- mmes_control(diagnostics=list(verbose=FALSE, dateWarning=FALSE))
fit <- mmes(y~x, data=dat, control=ctl)
coef(fit)
## modules only override the fields supplied
ctl2 <- mmes_control(convergence=list(maxIters=50),
output=list(covariance="none"),
diagnostics=list(verbose=FALSE, dateWarning=FALSE))
ctl2$convergence$maxIters
ctl2$convergence$likelihoodTol
## invalid choices are rejected
try(mmes_control(solve=list(method="gauss")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.