Description Usage Arguments Value Examples
Generate augmented data matrices Y' and X' for JACA based on supplied Z, X_list and alha
1 | generateAugmentedXY(Z, X_list, alpha = 0.5, missing = FALSE)
|
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 |
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'. |
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.