hpca: hclust_pca

Description Usage Arguments Examples

View source: R/subpca.R

Description

A type of pca that uses a hierarchical clustering to define a set of nested regions for pca compression.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
hpca(
  X,
  hclus,
  cuts,
  est_method = c("fixed", "gcv", "shrink"),
  ncomp = rep(1, length(cuts) + 1),
  center = TRUE,
  scale = FALSE,
  shrink_method = "GSURE"
)

Arguments

X

the data matrix

hclus

a hierarchical clustering instance with as many objects as there are rows in X

cuts

desired number of clusters at each level of the hierarchy (must be increasing)

ncomp

the number of components to estimate at each level

Examples

1
2
3
4
5
6
7
8
9
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")

bbuchsbaum/neuropls documentation built on Dec. 9, 2020, 7:02 p.m.