Description Usage Arguments Value Examples
Sparse Canonical Correlation Analysis
1 2 3 4 5 6 7 8 9 10 |
X1, X2 |
Matrices of covariates. |
l1, l2 |
Penalisation terms. |
K |
Number of canonical vector pairs. |
niter |
Number of iterations to run algorithm for (default = 1000). |
threshold |
Stopping criterea threshold (default = 1e-6). |
verbose |
Print debug information. |
List with canonical vectors w1
, w2
and the correlation
for the kth canonical vector pair given as t(w1) %% t(X1) %% X2 %*% w2.
1 2 3 4 5 6 7 8 9 | # From PMA::CCA
u <- matrix(c(rep(1,25),rep(0,75)),ncol=1)
v1 <- matrix(c(rep(1,50),rep(0,450)),ncol=1)
v2 <- matrix(c(rep(0,50),rep(1,50),rep(0,900)),ncol=1)
X1 <- u%*%t(v1) + matrix(rnorm(100*500),ncol=500)
X2 <- u%*%t(v2) + matrix(rnorm(100*1000),ncol=1000)
X1 <- scale(X1, T, F)
X2 <- scale(X2, T, F)
cca <- rCCA(X1, X2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.