| cdm.pca | R Documentation |
Performs a principal component analysis on the given data matrix using the methods of Yata and Aoshima (2009, 2010).
cdm.pca(X, K = 1, method = "CDM", scale = TRUE, orthogonal = FALSE)
X |
Data matrix of dimension |
K |
Number of principal components to be computed. If |
method |
Which method should be used to calculate the eigenvectors (loadings) and eigenvalues. |
scale |
Should the variables be scaled to have unit variance before the analysis takes place. Default is |
orthogonal |
The estimated eigenvectors (loadings) computed using |
This function performs principal component analysis using either the DM approach as described in Yata, K., Aoshima, M. (2009), or the CDM approach (Yata, K., Aoshima, M., 2010) Note that there is also a code implementation of CDM available at 'Aoshima Lab' (https://github.com/Aoshima-Lab/HDLSS-Tools/tree/main/CDM) provided by Makoto Aoshima.
A list with the following components:
v |
The first |
l |
The corresponding first estimated eigenvalues of the identified block diagonal covariance matrix. |
K |
The number of sparse singular vectors (loadings) that have been computed. |
Yata, K., Aoshima, M. (2009). PCA consistency for non-Gaussian data in high dimension, low sample size contex, Commun. Stat. - Theory Methods 38, 2634–2652.
Yata, K., Aoshima, M. (2010). Effective PCA for high-dimension, low-sample-size data with singular value decomposition of cross data matrix, J. Multivar. Anal. 101, 2060–2077.
#Example: run IS-PCA on a gene expression data set with two tissue types
if (requireNamespace("dslabs", quietly = TRUE)) {
data("tissue_gene_expression", package = "dslabs")
#We only select the two tissue types kidney (6) and liver (7)
Y <- as.numeric(tissue_gene_expression$y)
X <- scale(tissue_gene_expression$x[Y %in% c(6, 7), ], scale = FALSE)
Y <- Y[Y %in% c(6, 7)]
# Run PCA
pca.obj <- cdm.pca(X, K = 2)
PC <- X %*% pca.obj$v
# Plot the first two principal components
plot(PC, pch = Y-5, xlab = "PC1", ylab = "PC2")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.