gen_solver: General solver 'C++' function

View source: R/RcppExports.R

gen_solverR Documentation

General solver C++ function

Description

A general purpose optimization solver with orthogonality constraint. For details, please see the original MATLAB code by Wen and Yin (2013). This is an internal function and should not be called directly.

Usage

gen_solver(
  B,
  f,
  g,
  env,
  useg,
  rho,
  eta,
  gamma,
  tau,
  epsilon,
  btol,
  ftol,
  gtol,
  maxitr,
  verbose
)

Arguments

B

A matrix of the parameters B, the columns are subject to the orthogonality constraint

f

A function that calculates the objective function value. The first argument should be B. Returns a single value.

g

A function that calculates the gradient. The first argument should be B. Returns a matrix with the same dimension as B. If not specified, then the numerical approximation is used.

env

Environment passed to the Rcpp function for evaluating f and g

useg

If true, the gradient is calculated using g function, otherwise numerically approximated

rho

(don't change) Parameter for control the linear approximation in line search

eta

(don't change) Factor for decreasing the step size in the backtracking line search

gamma

(don't change) Parameter for updating C by Zhang and Hager (2004)

tau

(don't change) Step size for updating

epsilon

(don't change) Parameter for approximating numerical gradient, if g is not given.

btol

(don't change) The $B$ parameter tolerance level

ftol

(don't change) Functional value tolerance level

gtol

(don't change) Gradient tolerance level

maxitr

Maximum number of iterations

verbose

Should information be displayed

References

Wen, Z., & Yin, W. (2013). A feasible method for optimization with orthogonality constraints. Mathematical Programming, 142(1), 397-434. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10107-012-0584-1")}

Zhang, H., & Hager, W. W. (2004). A nonmonotone line search technique and its application to unconstrained optimization. SIAM journal on Optimization, 14(4), 1043-1056. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1137/S1052623403428208")}

Examples

# This function should be called internally. When having all objects pre-computed, one can call
# gen_solver(B, f, g, env, useg, rho, eta, gamma, tau, epsilon, btol, ftol, gtol, maxitr, verbose)
# to solve for the parameters B.

orthoDr documentation built on April 30, 2023, 5:12 p.m.