build.control {abn} | R Documentation |
Control the iterations in buildScoreCache
Description
Allow the user to set restrictions in the buildScoreCache
for both the Bayesian and the MLE approach.
Control function similar to fit.control
.
Usage
build.control(
method = "bayes",
max.mode.error = 10,
mean = 0,
prec = 0.001,
loggam.shape = 1,
loggam.inv.scale = 5e-05,
max.iters = 100,
epsabs = 1e-07,
error.verbose = FALSE,
trace = 0L,
epsabs.inner = 1e-06,
max.iters.inner = 100,
finite.step.size = 1e-07,
hessian.params = c(1e-04, 0.01),
max.iters.hessian = 10,
max.hessian.error = 0.5,
factor.brent = 100,
maxiters.hessian.brent = 100,
num.intervals.brent = 100,
n.grid = 250,
ncores = 1,
cluster.type = "FORK",
max.irls = 100,
tol = 1e-08,
tolPwrss = 1e-07,
check.rankX = "message+drop.cols",
check.scaleX = "message+rescale",
check.conv.grad = "message",
check.conv.singular = "message",
check.conv.hess = "message",
xtol_abs = 1e-06,
ftol_abs = 1e-06,
trace.mblogit = FALSE,
catcov.mblogit = "free",
epsilon = 1e-06,
seed = 9062019L
)
Arguments
method |
a character that takes one of two values: "bayes" or "mle". Overrides |
max.mode.error |
if the estimated modes from INLA differ by a factor of |
mean |
the prior mean for all the Gaussian additive terms for each node. INLA argument |
prec |
the prior precision ( |
loggam.shape |
the shape parameter in the Gamma distribution prior for the precision in a Gaussian node. INLA argument |
loggam.inv.scale |
the inverse scale parameter in the Gamma distribution prior for the precision in a Gaussian node. INLA argument |
max.iters |
total number of iterations allowed when estimating the modes in Laplace approximation. passed to |
epsabs |
absolute error when estimating the modes in Laplace approximation for models with no random effects. Passed to |
error.verbose |
logical, additional output in the case of errors occurring in the optimization. Passed to |
trace |
Non-negative integer. If positive, tracing information on the progress of the "L-BFGS-B" optimization is produced. Higher values may produce more tracing information. (There are six levels of tracing. To understand exactly what these do see the source code.). Passed to |
epsabs.inner |
absolute error in the maximization step in the (nested) Laplace approximation for each random effect term. Passed to |
max.iters.inner |
total number of iterations in the maximization step in the nested Laplace approximation. Passed to |
finite.step.size |
suggested step length used in finite difference estimation of the derivatives for the (outer) Laplace approximation when estimating modes. Passed to |
hessian.params |
a numeric vector giving parameters for the adaptive algorithm, which determines the optimal stepsize in the finite-difference estimation of the hessian. First entry is the initial guess, second entry absolute error. Passed to |
max.iters.hessian |
integer, maximum number of iterations to use when determining an optimal finite difference approximation (Nelder-Mead). Passed to |
max.hessian.error |
if the estimated log marginal likelihood when using an adaptive 5pt finite-difference rule for the Hessian differs by more than |
factor.brent |
if using Brent-Dekker root bracketing method then define the outer most interval end points as the best estimate of |
maxiters.hessian.brent |
maximum number of iterations allowed in the Brent-Dekker method. Passed to |
num.intervals.brent |
the number of initial different bracket segments to try in the Brent-Dekker method. Passed to |
n.grid |
recompute density on an equally spaced grid with |
ncores |
The number of cores to parallelize to, see ‘Details’. If >0, the number of CPU cores to be used. -1 for all available -1 core. Only for |
cluster.type |
The type of cluster to be used, see |
max.irls |
total number of iterations for estimating network scores using an Iterative Reweighed Least Square algorithm. Is this DEPRECATED? |
tol |
real number giving the minimal tolerance expected to terminate the Iterative Reweighed Least Square algorithm to estimate network score. Passed to |
tolPwrss |
numeric scalar passed to |
check.rankX |
character passed to |
check.scaleX |
character passed to |
check.conv.grad |
character passed to |
check.conv.singular |
character passed to |
check.conv.hess |
character passed to |
xtol_abs |
Defaults to 1e-6 stop on small change of parameter value. Only for |
ftol_abs |
Defaults to 1e-6 stop on small change in deviance. Similar to |
trace.mblogit |
logical indicating if output should be produced for each iteration. Directly passed to |
catcov.mblogit |
Defaults to "free" meaning that there are no restrictions on the covariances of random effects between the logit equations. Set to "diagonal" if random effects pertinent to different categories are uncorrelated or "single" if random effect variances pertinent to all categories are identical. |
epsilon |
Defaults to 1e-8. Positive convergence tolerance |
seed |
a non-negative integer which sets the seed in |
Details
Parallelization over all children is possible via the function foreach
of the package doParallel. ncores=0
or ncores=1
use single threaded foreach
. ncores=-1
uses all available cores but one.
Value
Named list according the provided arguments.
See Also
Other buildScoreCache:
buildScoreCache()
Examples
ctrlmle <- abn::build.control(method = "mle",
ncores = 0,
cluster.type = "PSOCK",
max.irls = 100,
tol = 10^-11,
tolPwrss = 1e-7,
check.rankX = "message+drop.cols",
check.scaleX = "message+rescale",
check.conv.grad = "message",
check.conv.singular = "message",
check.conv.hess = "message",
xtol_abs = 1e-6,
ftol_abs = 1e-6,
trace.mblogit = FALSE,
catcov.mblogit = "free",
epsilon = 1e-6,
seed = 9062019L)
ctrlbayes <- abn::build.control(method = "bayes",
max.mode.error = 10,
mean = 0, prec = 0.001,
loggam.shape = 1,
loggam.inv.scale = 5e-05,
max.iters = 100,
epsabs = 1e-07,
error.verbose = FALSE,
epsabs.inner = 1e-06,
max.iters.inner = 100,
finite.step.size = 1e-07,
hessian.params = c(1e-04, 0.01),
max.iters.hessian = 10,
max.hessian.error = 0.5,
factor.brent = 100,
maxiters.hessian.brent = 100,
num.intervals.brent = 100,
tol = 10^-8,
seed = 9062019L)