Description Usage Arguments Details Value References Examples
View source: R/OptStiefelGBB.R
Curvilinear search algorithm for optimization on Stiefel manifold developed by Wen and Yin (2013).
1 | OptStiefelGBB(X, fun, opts = NULL, ...)
|
X |
Initial value to start the optimization. A n by k orthonormal matrix such that X^T X = I_k. |
fun |
The function that returns the objective function value and its gradient. The syntax for |
opts |
A list specifying additional user-defined arguments for the curvilinear search algorithm. Some important ones are listed in the following:
The default values are: |
... |
Additional input passed to |
The calling syntax is OptStiefelGBB(X, fun, opts, data1, data2)
, where fun(X, data1, data2)
returns the objective function value and its gradient.
For example, for n by k matrix X, the optimization problem is
min_{X} -tr(X^T W X), \mbox{ such that } X^T X = I_k.
The objective function and its gradient are
F(X) = -tr(X^T W X), \; G(X) = - 2 W X.
Then we need to provide the function fun(X, W)
which returns F(X) and G(X). See Examples for details.
For more details of the termination rules and the tolerances, we refer the interested readers to Section 5.1 of Wen and Yin (2013).
X |
The converged solution of the optimization problem. |
out |
Output information, including estimation error, function value, iteration times etc.
|
Wen, Z. and Yin, W., 2013. A feasible method for optimization with orthogonality constraints. Mathematical Programming, 142(1-2), pp.397-434.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | n <- 1000
k <- 6
# Randomly generated matrix M
W <- matrix(rnorm(n^2), n, n)
W <- t(W) %*% W
# Randomly generated orthonormal initial matrix
X0 <- matrix(rnorm(n*k), n, k)
X0 <- qr.Q(qr(X0))
# The objective function and its gradient
fun <- function(X, W){
F <- - sum(diag(t(X) %*% W %*% X))
G <- - 2*(W %*% X)
return(list(F = F, G = G))
}
# Options list
opts<-list(record = 0, maxiter = 1000, xtol = 1e-5, gtol = 1e-5, ftol = 1e-8)
# Main part
output <- OptStiefelGBB(X0, fun, opts, W)
X <- output$X
out <- output$out
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.