OptStiefelGBB: Gradient based optimization on the Stiefel manifold

Description Usage Arguments Details Value References Examples

View source: R/OptStiefelGBB.R

Description

Gradient based optimization on the Stiefel manifold

Usage

1
OptStiefelGBB(fun, X, size, opts, ...)

Arguments

fun

function to be minimized. It must take X as the first argument and return a list with two named elements: f, which is the value of the objective function and G, which is the derivative

X

the initial orthonormal matrix

size

if initial value for X is not given, the number of rows and columns can be given instead in a two-element vector. Number of columns must be less than the number of rows

opts

a list of options for the optimization

...

additional argmuents to pass to fun

Details

This R package ports the MATLAB code from the authors' website http://optman.blogs.rice.edu/

Value

list with X, which is the solution found, and out, which includes supplementary material

References

Zaiwen Wen and Wotao Yin. A Feasible method for Optimization with Orthogonality Constraints, Optimization Online, 11/2010. Also as Rice CAAM Tech Report TR10-26.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# find the first eigenvector
fun <- function(X,  A) {
  G = -(A %*% X)
  f = 0.5 * sum(t(G) %*% X)
  list(f = f, G = G)
}

n = 1000; k = 1
A = matrix(rnorm(n^2), n, n)
A = t(A) %*% A

res = OptStiefelGBB(fun, size = c(n, k), A = A)

# objective function should be close to the sum of the first eigenvalue
eig = eigen(A)
sum(eig$values[1:k])
-2 * res$out$fval

plot(res$X[, 1], eig$vectors[, 1])

andland/FOptM documentation built on May 30, 2019, 11:43 a.m.