MyNixOS website logo
Description

Alternating Manifold Proximal Gradient Method for Sparse PCA.

Alternating Manifold Proximal Gradient Method for Sparse PCA uses the Alternating Manifold Proximal Gradient (AManPG) method to find sparse principal components from a data or covariance matrix. Provides a novel algorithm for solving the sparse principal component analysis problem which provides advantages over existing methods in terms of efficiency and convergence guarantees. Chen, S., Ma, S., Xue, L., & Zou, H. (2020) <doi:10.1287/ijoo.2019.0032>. Zou, H., Hastie, T., & Tibshirani, R. (2006) <doi:10.1198/106186006X113430>. Zou, H., & Xue, L. (2018) <doi:10.1109/JPROC.2018.2846588>.

amanpg

Description

Uses an alternating manifold proximal gradient (AManPG) method to find sparse principal components from the given data or covariance matrix.

Only base R is required to be installed.

Usage

spca.amanpg(z, lambda1, lambda2, f_palm = 1e5, x0 = NULL, y0 = NULL, k = 0, type = 0, gamma = 0.5,
                        maxiter = 1e4, tol = 1e-5, normalize = TRUE, verbose = FALSE)

Arguments

NameTypeDescription
zmatrixEither the data matrix or sample covariance matrix
lambda1matrixList of parameters of length n for L1-norm penalty
lambda2doubleL2-norm penalty term
f_palmdoubleUpper bound for the gradient value to reach convergence, default value is 1e5
x0matrixInitial x-values for the gradient method, default value is the first n right singular vectors
y0matrixInitial y-values for the gradient method, default value is the first n right singular vectors
kintegerNumber of principal components desired, default is 0 (returns min(n-1, p) principal components)
typeintegerIf 0, b is expected to be a data matrix, and otherwise b is expected to be a covariance matrix; default is 0
gammadoubleParameter to control how quickly the step size changes in each iteration, default is 0.5
maxiterintegerMaximum number of iterations allowed in the gradient method, default is 1e4
toldoubleTolerance value required to indicate convergence (calculated as difference between iteration f-values), default is 1e-5
normalizelogicalCenter and normalize rows to Euclidean length 1 if True, default is True
verboselogicalFunction prints progress between iterations if True, default is False

Value

Returns a dictionary with the following key-value pairs:

KeyValue TypeValue
iterintegerTotal number of iterations executed
f_manpgdoubleFinal gradient value
sparsityfloatNumber of sparse loadings (loadings == 0) divided by number of all loadings
timedoubleNumber of seconds for execution
xmatrixCorresponding ndarray in subproblem to the loadings
loadingsmatrixLoadings of the sparse principal components

Authors

Shixiang Chen, Justin Huang, Benjamin Jochem, Shiqian Ma, Lingzhou Xue and Hui Zou

References

Chen, S., Ma, S., Xue, L., and Zou, H. (2020) "An Alternating Manifold Proximal Gradient Method for Sparse Principal Component Analysis and Sparse Canonical Correlation Analysis" INFORMS Journal on Optimization 2:3, 192-208

Zou, H., Hastie, T., & Tibshirani, R. (2006). Sparse principal component analysis. Journal of Computational and Graphical Statistics, 15(2), 265-286.

Zou, H., & Xue, L. (2018). A selective overview of sparse principal component analysis. Proceedings of the IEEE, 106(8), 1311-1320.

Example

See SPCA.R for a more in-depth example.

library('SPCA')

#see SPCA.R for a more in-depth example
      d <- 500  # dimension
      m <- 1000 # sample size
      set.seed(10)
      a <- normalize(matrix(rnorm(m * d), m, d))
      lambda1 <- 0.1 * matrix(data=1, nrow=4, ncol=1)
      x0 <- svd(a, nv=4)$v
      sprout <- spca.amanpg(a, lambda1, lambda2=Inf, f_palm=1e5, x0=x0, y0=x0, k=4, type=0, gamma=0.5,
                            maxiter=1e4, tol=1e-5, normalize = FALSE, verbose=FALSE)
      print(paste(sprout$iter, "iterations,", sprout$sparsity, "sparsity,", sprout$time))

      #extract loadings
      #print(sprout$loadings)
Metadata

Version

0.3.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows