| consensuspca | R Documentation |
Algorithms fitting a consensus PCA of a list of matrices Xlist. A chosen PCA algorithm is applied on the X-matrix obtained after variable scaling, blockscaling, block concatenation.
Auxiliary functions
transform Calculates the principal components for any new matrix X from the model.
summary returns summary information for the model.
consensuspca(Xlist, blockscaling = TRUE, weights = NULL, nlv,
Xscaling = c("none", "pareto", "sd")[1],
algo = c("svd","eigen","eigenk","nipals","nipalsna","sph")[1],
gs = TRUE, tol = .Machine$double.eps^0.5, maxit = 200)
## S3 method for class 'Consensuspca'
transform(object, X, ..., nlv = NULL)
## S3 method for class 'Consensuspca'
summary(object, X, ...)
Xlist |
For the main function: list of training X-data ( |
X |
For the auxiliary functions: list of new X-data, with the same variables than the training X-data. |
blockscaling |
logical. If TRUE, the scaling factor (computed on the training) is the "norm" of the block, i.e. the square root of the sum of the variances of each column of the block. |
weights |
excepted for "nipalsna". Weights ( |
nlv |
For the main functions: The number(s) of PCs to calculate. — For the auxiliary functions: The number(s) of PCs to consider. |
Xscaling |
vector (of length Xlist) of variable scaling for each datablock, among "none" (mean-centering only), "pareto" (mean-centering and pareto scaling), "sd" (mean-centering and unit variance scaling). If "pareto" or "sd", uncorrected standard deviation is used. |
algo |
For |
object |
For the auxiliary functions: A fitted model, output of a call to the main functions. |
... |
For the auxiliary functions: Optional arguments. Not used. |
Specific for the NIPALS algorithm
gs |
Logical indicating if a Gram-Schmidt orthogonalization is implemented or not (default to |
tol |
Tolerance for testing convergence of the NIPALS iterations for each PC. |
maxit |
Maximum number of NIPALS iterations for each PC. |
For consensuspca:
T |
The X-score matrix ( |
P |
The X-loadings matrix ( |
sv |
The singular values ( |
eig |
The eigenvalues ( |
xmeans |
The list of centering vectors of |
xscales |
The list of |
weights |
Weights applied to the training observations. |
blockscaling |
block scaling. |
Xnorms |
"norm" of each block, i.e. the square root of the sum of the variances of each column of each block, computed on the training, and used as scaling factor |
.
niter |
Numbers of iterations of the NIPALS. |
conv |
Logical indicating if the NIPALS converged before reaching the maximal number of iterations. |
For transform.Consensuspca: X-scores matrix for new Xlist-data.
For summary.Consensuspca:
explvarx |
matrix of explained variances. |
contr_ind |
observation contributions. |
contr_var |
variable contributions. |
coord_var |
variable coordinates. |
cor_circle |
variable coordinates on the correlation circle. |
Mangamana, E.T., Cariou, V., Vigneau, E., Glele Kakai, R.L., Qannari, E.M., 2019. Unsupervised multiblock data analysis: A unified approach and extensions. Chemometrics and Intelligent Laboratory Systems 194, 103856. https://doi.org/10.1016/j.chemolab.2019.103856
Westerhuis, J.A., Kourti, T., MacGregor, J.F., 1998. Analysis of multiblock and hierarchical PCA and PLS models. Journal of Chemometrics 12, 301–321. https://doi.org/10.1002/(SICI)1099-128X(199809/10)12:5<301::AID-CEM515>3.0.CO;2-S
n <- 10 ; p <- 10
Xtrain <- matrix(rnorm(n * p), ncol = p)
ytrain <- rnorm(n)
m <- 2
Xtest <- matrix(rnorm(m * p), ncol = p)
colnames(Xtrain) <- colnames(Xtest) <- paste("v", 1:p, sep = "")
Xtrain
Xtest
blocks <- list(1:2, 4, 6:8)
X1 <- mblocks(Xtrain, blocks = blocks)
X2 <- mblocks(Xtest, blocks = blocks)
nlv <- 3
fm <- consensuspca(Xlist = X1, Xscaling = c("sd","none","none"),
blockscaling = TRUE, weights = NULL, nlv = nlv)
summary(fm, X1)
transform(fm, X2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.