selectu: Function that guides a selection of the terminating index...

View source: R/seedCCA.R

selectuR Documentation

Function that guides a selection of the terminating index when using seedCCA function

Description

The usage of selectu depends on one of its arguments, type. If tyep="seed1", the n*F_u is computed for a higher dimension one of X and Y and a proper number of prjections is reported. For example, suppose that the dimension of X is higher than Y. Then selectu(X,Y, type="case1") and selectu(Y, X, u=5, type="case1") gives the same results, and it is for X. If type="seed2", n*F_u is computed for X and Y and proper numbers of projections for X and Y are reported. And, For type="seed2", num.d must be specified. Its defualt value is 2. The argument eps is a terminating condition for stopping projections. The projection is stopped, when the increment is less than the value of eps. The argument auto.stop=TRUE has the function automatically stopped as soon as the increment is less than the value of eps. If not, the increments are computed until the value of u.max is reached. The function selectu results in subclass "selectu".

Usage

selectu(X, Y, type="seed2", u.max=30, auto.stop=TRUE, num.d=2, eps=0.01)

Arguments

X

numeric matrix (n * p), the first set of variables

Y

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

type

character, the default is "seed2". "seed1" is for the first case of Seeded CCA (One set of variable is initially-reduced). "seed2" is for the second case of Seeded CCA (Two sets of variables are initially reduced).

u.max

numeric, t he maximum number of u. The default is equal to 30.

auto.stop

logical, The default value is TRUE. If TRUE, the iterative projection is automatically stopped, when the terminaion condition eps is satisfied. If FALSE, the iterative projections are stopped at the value of u.max.

num.d

numeric, the number of the "num.d" largest eigenvectors of cov(first.set, second.set), if case1=FALSE. The default value is equal to 2. This option works only for type="seed2".

eps

numeric, the default value is equal to 0.01. A value for terminating the projection.

Details

The order of the values depending on type is follows:

type="seed1"

type="seed2"

Value

type="seed1"

Values with selecting type="seed1":

nFu

incrments (n*Fu) of the iterative projection for initally reduction one set of variable.

proper.u

proper value of the number of projections for X

type

types of seeded CCA

eps

a value for terminating the projection. The default value is equal to 0.01.

type="seed2"

Values with selecting type="seed2":

nFu.x

incrments (n*Fu) of the iterative projection for initially reducing X.

nFu.y

incrments (n*Fu) of the iterative projection for initially reducing Y.

proper.ux

proper value of the number of projections for X

proper.uy

proper value of the number of projections for Y

type

types of seeded CCA

eps

a value for terminating the projection. The default value is equal to 0.01.

Examples

######  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])

selectu(X, Y, type="seed1")
selectu(X, Y, type="seed1", auto.stop=FALSE)
selectu(X, Y, type="seed2", eps=0.001, num.d=3)
selectu(X, Y, type="seed2", auto.stop=FALSE)



########  data(nutrimouse) ########
data(nutrimouse)
Y<-as.matrix(nutrimouse$lipid)
X<-as.matrix(nutrimouse$gene)
selectu(X, Y, type="seed2", num.d=4)
selectu(X, Y, type="seed2", num.d=4, eps=0.001)
selectu(X, Y, type="seed2", auto.stop=FALSE, num.d=4, eps=0.001)

seedCCA documentation built on June 9, 2022, 9:05 a.m.

Related to selectu in seedCCA...