iniCCA: Initialized CCA in seeded CCA

Description Usage Arguments Value Examples

View source: R/iniCCA.R

Description

Returns the canonical coefficient matrices from the initialized step in seeded CCA. The initialzied CCA is done only for the first set in its first argument. The "num.d" must be bigger than or equal to the dimension of the second set.

Usage

1
iniCCA(first.set, second.set, u, num.d)

Arguments

first.set

numeric matrix (n * p), the first set of variables: this set of variables alone is reduced.

second.set

numeric matrix (n * r), the second set of variables

u

numeric, the terminiating index of the projection

num.d

numeric, the first "num.d" eigenvectors of cov(X,Y) to replace cov(X,Y), if min(p,r) relatively bigger than n. The "num.d" must be less than or equal to min(p,r).

Value

B

the initialized CCAed X projected up to u

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
########  data(cookie) ########
data(cookie)
myseq<-seq(141,651,by=2)
X<-as.matrix(cookie[-c(23,61),myseq])
Y<-as.matrix(cookie[-c(23,61),701:704])
min.pr <- min( dim(X)[2], dim(Y)[2])
MX0 <- iniCCA(X, Y, u=4, num.d=min.pr)
ini.X <- X%*%MX0

########  data(nutrimouse) ########
data(nutrimouse)
Y<-as.matrix(nutrimouse$lipid)
X<-as.matrix(nutrimouse$gene)
MX0 <- iniCCA(X, Y, u=4, num.d=4)
MY0 <- iniCCA(Y, X, u=5, num.d=4)
ini.X <- X %*% MX0
ini.Y <- Y %*% MY0

seedCCA documentation built on Aug. 30, 2017, 5:09 p.m.

Related to iniCCA in seedCCA...