SparseCCA: Implement SparseCCA

SparseCCAR Documentation

Implement SparseCCA

Description

Implement an iterative penalized least squares approach to sparse canonical correlation analysis (SparseCCA) with various penalty functions. Modified Wilms, Ines, and Christophe Croux. "Robust sparse canonical correlation analysis." BMC systems biology 10.1 (2016): 1-13. The original code is accessible https://sites.google.com/view/iwilms/software?authuser=0

INPUT

Usage

SparseCCA(
  X,
  Y,
  Xmethod = c("lasso", "alasso", "gglasso", "SGL"),
  Ymethod = c("lasso", "alasso", "OLS"),
  init.method = "SVD",
  X.groupidx = NULL,
  standardize = T,
  max.iter = 50,
  conv = 5 * 10^-2
)

Arguments

X

: n by p exposure data matrix, where n is sample size and p is number of exposures.

Y

: n by q outcome data matrix, where n is sample size and q is number of outcomes.

Xmethod

: penalty function for the exposure, i.e. penalty function when regressing Y onto X. Possible values are:

  • "lasso": Lasso

  • "alasso": Adaptive Lasso

  • "gglasso": Group Lasso

  • "SGL": Sparse Group Lasso

Ymethod

: penalty function for the outcome, i.e. penalty function when regressing X onto Y. Possible values are:

  • "lasso": Lasso

  • "alasso": Adaptive Lasso

  • "OLS": Ordinary Least Square

init.method

: "Possible two values are:

  • "lasso": When high-dimensional exposure data (i.e. n<p)

  • "OLS": Ordinary Least Square

  • "SVD": Singular Value Decomposition

X.groupidx

: A vector of length p that indicates grouping structure of exposure X

standardize

: A logical flag for exposure X and outcome Y standardization, prior to fitting the model.

max.iter

: A maximum number of iterations

conv

: A tolerance value for convergence epsilon

Value

The function returns a list of 6 objects according to the following order:

  • ALPHA : An estimated canonical vector of length p corresponding to the exposure data X

  • BETA : An estimated canonical vector of length q corresponding to the outcome data Y

  • U_ALL : An estimated canonical variates corresponding to the exposure data X which is a vector of length n

  • V_ALL : An estimated canonical variates corresponding to the outcome data Y which is a vector of length n

  • lamdbaA : A numeric value of the sparsity parameter lambdaA

  • lamdbaB : A numeric value of the sparsity parameter lambdaB

  • it : Number of iterations until convergence

Examples

data.list <- generate.data(n=500)
DATA.X <- data.list$DATA.X
DATA.Y <- data.list$DATA.Y
SparseCCA.result <- SparseCCA(X=DATA.X,Y=DATA.Y,Xmethod="SGL",Ymethod="lasso",X.groupidx=c(rep(1,4),rep(2,3),rep(3,2),rep(1,3)))
str(SparseCCA.result)
projection.error(data.list$TRUE.ALPHA,SparseCCA.result$ALPHA)
projection.error(data.list$TRUE.BETA,SparseCCA.result$BETA)



jennyjyounglee/AclustsCCA documentation built on June 15, 2022, 7:45 p.m.