hpca | R Documentation |
A type of pca that uses a hierarchical clustering to define a set of nested regions for pca compression.
hpca( X, hclus, cuts, est_method = c("fixed", "gcv", "shrink"), ncomp = rep(1, length(cuts) + 1), center = TRUE, scale = FALSE, shrink_method = "GSURE" )
X |
the data matrix |
hclus |
a hierarchical clustering instance with as many objects as there are rows in |
cuts |
desired number of clusters at each level of the hierarchy (must be increasing) |
ncomp |
the number of components to estimate at each level |
grid <- expand.grid(1:10, 1:10) X <- matrix(rnorm(100*50), 100, 50) cuts <- c(4, 8, 16) hclus <- hclust(dist(grid)) hres1 <- hpca(X, hclus, cuts, est_method="fixed", ncomp=c(4,1,1,1)) ncomp(hres1) == (sum(cuts) +4) hres2 <- hpca(X, hclus, cuts, est_method="shrink") hres3 <- hpca(X, hclus, cuts, est_method="gcv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.