generateAugmentedXY: Generate augmented data matrices Y' and X' for JACA based on...

Description Usage Arguments Value Examples

View source: R/Augmented.R

Description

Generate augmented data matrices Y' and X' for JACA based on supplied Z, X_list and alha

Usage

1
generateAugmentedXY(Z, X_list, alpha = 0.5, missing = FALSE)

Arguments

Z

An N by K class indicator matrix; rows are samples and columns are class indicator vectors with z_k = 1 if observation belongs to class k.

X_list

A list of input data matrices; in each sublist, rows are samples and columns are features.

alpha

The parameter to control the weight between optimal scoring and CCA part. Default is 0.5.

missing

Logical. If False, input data X_list must be complete and have no missing values. If True, input data X_list should contain missing values.

Value

A list with

bigx

Augmented matrix X'.

bigy

Augmented matrix Y'.

coef

A list of length D of scaling coefficients from standardization of X_list when forming X'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(1)
# Generate class indicator matrix Z
n = 10
Z=matrix(c(rep(1, n),rep(0, 2 * n)), byrow = FALSE, nrow = n)
for(i in 1:n){
  Z[i, ] = sample(Z[i, ])
}

# Generate input data X_list
d = 2; p = 5
X_list = sapply(1:d, function(i) list(matrix(rnorm(n * p), n, p)))

# Generate augmented X' and Y'
out = generateAugmentedXY(Z, X_list)
out$bigx
out$bigy

Pennisetum/JACA documentation built on April 30, 2021, 12:30 a.m.