GCElm.control: Auxiliary for Controlling GCE Fitting

GCElm.controlR Documentation

Auxiliary for Controlling GCE Fitting

Description

Auxiliary function for GCE fitting. Typically only used internally by GCElm.fit.

Usage

GCElm.control(m = 6, gtol = 0.9, max_linesearch = 20, invisible = 1,
  linesearch_algorithm = "LBFGS_LINESEARCH_BACKTRACKING")

Arguments

m

numeric, the number of corrections to approximate the inverse Hessian matrix; see lbfgs.

gtol

numeric, a parameter to control the accuracy of the line search routine; see lbfgs.

max_linesearch

numeric, the maximum number of trials for the line search; this parameter controls the number of function and gradients evaluations per iteration for the line search routine; the default value is 20; see lbfgs.

invisible

numeric, defaults to 0; set to 1 to suppress console output.

linesearch_algorithm

string, the line search algorithm; this parameter specifies a line search algorithm to be used by the L-BFGS routine; see lbfgs.

Details

The control argument of GCElm.fit is by default passed to the control argument of GCElm.fit, which uses its elements as arguments to GCElm.control: the latter provides defaults and sanity checking.

Value

A list with components named as the arguments.

Author(s)

Marco Sandri, Enrico Ciavolino, Maurizio Carpita (gcemodels@gmail.com)

References

Golan (1996)

Examples

set.seed(1234)
N <- 25000
K <- 10
y <- runif(N)
X <- matrix(runif(N*K), nrow = N, ncol = K)
X <- cbind(rep(1, N), X)
Z <- matrix(rep(c(-1, -0.5, 0, 0.5, 1), K+1), nrow = K+1, byrow = TRUE)
GCElm_control <- GCElm.control(m=8, gtol=0.95)
GCEfit <- GCElm.fit(y, X, Z, control=GCElm_control)
data.frame(beta = GCEfit$beta,
           beta_lb = GCEfit$beta-1.96*sqrt(diag(GCEfit$var_beta)),
           beta_ub = GCEfit$beta+1.96*sqrt(diag(GCEfit$var_beta))
           )

gcemodels/GCEmodels documentation built on Aug. 10, 2024, 1:58 a.m.