optStiefel: Optimize a function on the Stiefel manifold

Description Usage Arguments Value Author(s) References Examples

View source: R/opt.stiefel.R

Description

Find a local optimum of a function defined on the stiefel manifold using algorithms described in Wen and Yin (2013).

Usage

1
2
optStiefel(F, dF, Vinit, method = "bb", searchParams = NULL, tol = 1e-05,
  maxIters = 100, verbose = FALSE, maxLineSearchIters = 20)

Arguments

F

A function V(P, S) -> R^1

dF

A function to compute the gradient of F. Returns a P x S matrix with dF(X)_ij = d(F(X))/dX_ij

Vinit

The starting point on the stiefel manifold for the optimization

method

Line search type: "bb" or curvilinear

searchParams

List of parameters for the line search algorithm. If the line search algorithm is the standard curvilinear search than the search parameters are rho1 and rho2. If the line search algorithm is "bb" then the parameters are rho and eta.

tol

Convergence tolerance. Optimization stops when Fprime < abs(tol), an approximate stationary point.

maxIters

Maximum iterations for each gradient step

verbose

Boolean indicating whether to print function value and iteration number at each step.

maxLineSearchIters

Maximum iterations for for each line search (one step in the gradient descent algorithm)

Value

A stationary point of F on the Stiefel manifold.

Author(s)

Alexander Franks

References

(Wen and Yin, 2013)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Find the first eigenspace spanned by the first P eigenvectors for a 
## matrix M. The size of the matrix has been kept small and the tolerance 
## has been raised to keep the runtime 
## of this example below the CRAN submission threshold. 

N <- 500
P <- 3
Lam <- diag(c(10, 5, 3, rep(1, N-P)))
U <- rustiefel(N, N)
M <- U %*% Lam %*% t(U)

F <- function(V) { - sum(diag(t(V) %*% M %*% V)) }
dF <- function(V) { - 2*M %*% V }
V = optStiefel(F, dF, Vinit=rustiefel(N, P),
               method="curvilinear",
               searchParams=list(rho1=0.1, rho2=0.9, tau=1),tol=1e-4)
               
print(sprintf("Sum of first %d eigenvalues is %f", P, -F(V)))

rstiefel documentation built on June 12, 2018, 5:19 p.m.