Function for extracting latent components from L - structure data using the NIPALS algorithm.
extractscores(X1, X2, X3, niter = 5, threshold = 0)
X1 | A data matrix (n x q) whose rows is connected to the rows of X2 |
---|---|
X2 | A data matrix (n x p) whose rows is connected to the rows of X1, and whose columns are connected to the columns of X3. |
X3 | A data matrix (m x p) whose columns are connected toe the columns of X2. |
niter | Number of NIPALS iterations. |
threshold | A threshold parameter in [0, 1) for potential soft - thresholding of the rows of X3. |
Returns a list og six latent vectors (normalized).
data(BCdata) scores <- extractscores(BCdata$Y, BCdata$X, BCdata$Z) str(scores)#> List of 6 #> $ t11: num [1, 1] -1 #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr "Class" #> .. ..$ : NULL #> $ t12: num [1:130, 1] -0.123 0 0 -0.123 0 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:130] "subject1" "subject2" "subject3" "subject4" ... #> .. ..$ : NULL #> $ t21: num [1:130, 1] 0.1689 0.0354 0.1048 -0.1181 -0.0646 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:130] "subject1" "subject2" "subject3" "subject4" ... #> .. ..$ : NULL #> $ t22: num [1:486, 1] 0.04834 -0.04618 0.00638 -0.07267 -0.01525 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:486] "gene1" "gene2" "gene3" "gene4" ... #> .. ..$ : NULL #> $ t31: num [1:486, 1] 0.0451 -0.0869 0.0195 -0.0391 0.0355 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:486] "gene1" "gene2" "gene3" "gene4" ... #> .. ..$ : NULL #> $ t32: num [1:486, 1] 0.0584 -0.1607 0.0348 -0.0599 0.0446 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:486] "gene1" "gene2" "gene3" "gene4" ... #> .. ..$ : NULL