
Find a Grassmann base point via multi-start optimization.
Source:R/manifold-grassmann.R
optimize_base_point_grassmann.RdGrassmann case of optimize_base_point: numerically
minimizes the total Grassmann distance (dist_grassmann)
from a candidate point to every row of X. The search is
unconstrained, over the tangent space at the projection mean
(auto_base_point_grassmann), with restarts drawn from a
Gaussian scaled to the spread of the data. See
choose_base_point.
Arguments
- X
A matrix or data frame of Grassmann data; rows are samples, with
n * kcolumns (seemanifold_grassmann).- n
Integer: dimension of the ambient space.
- k
Integer: dimension of the subspaces,
1 <= k <= n - 1.- n_start
Number of random restarts used to avoid local minima of the (non-convex) objective. Defaults to 10.
- maxit
Maximum number of
optimiterations per restart. Defaults to 200.- seed
Integer random seed used to generate the restart points, for reproducibility. Defaults to 42.
Value
A list with three elements: p (the best point found
across all restarts, as a vector of length n * k), value
(its total Grassmann distance to the rows of X), and
convergence (the optim convergence code of
the best restart; 0 indicates successful convergence).
Examples
X <- exp_map_grassmann(matrix(rnorm(40, sd = 0.3), nrow = 10), diag(4)[, 1:2])
optimize_base_point_grassmann(X, n = 4, k = 2, n_start = 3)
#> $p
#> [1] 0.969052410 -0.209518770 -0.041681316 0.123701173 -0.223729175
#> [6] -0.967802495 0.005286253 0.115219972
#>
#> $value
#> [1] 4.635188
#>
#> $convergence
#> [1] 0
#>