如果您从 R 中使用 igraph,请使用此选项
dim_select {igraph} | R 文档 |
通过以规范的方式查找碎石图的“肘部”,选择显着奇异值的数量。
dim_select(sv)
sv |
一个数值向量,有序奇异值。 |
该函数的输入是一个数值向量,其中包含每个维度的“重要性”度量。
对于谱嵌入,这些是邻接矩阵的奇异值。 奇异值被假定为来自具有两个分量的高斯混合分布,这两个分量具有不同的均值和相同的方差。 当d
个最大奇异值分配给混合的一个分量,其余奇异值分配给混合的另一个分量时,维度d
被选择来最大化似然。
此函数也可用于一般分离问题,其中我们假设向量的左侧和右侧来自两个具有不同均值的正态分布,并且我们想知道它们的边界。 请参见以下示例。
一个数值标量,d
的估计值。
Gabor Csardi csardi.gabor@gmail.com
M. Zhu, and A. Ghodsi (2006). 通过使用剖面似然从碎石图中自动选择维度。 计算统计与数据分析, Vol. 51, 918–930.
# Generate the two groups of singular values with
# Gaussian mixture of two components that have different means
sing.vals <- c( rnorm (10, mean=1, sd=1), rnorm(10, mean=3, sd=1) )
dim.chosen <- dim_select(sing.vals)
dim.chosen
# Sample random vectors with multivariate normal distribution
# and normalize to unit length
lpvs <- matrix(rnorm(200), 10, 20)
lpvs <- apply(lpvs, 2, function(x) { (abs(x) / sqrt(sum(x^2))) })
RDP.graph <- sample_dot_product(lpvs)
dim_select( embed_adjacency_matrix(RDP.graph, 10)$D )
# Sample random vectors with the Dirichlet distribution
lpvs.dir <- sample_dirichlet(n=20, rep(1, 10))
RDP.graph.2 <- sample_dot_product(lpvs.dir)
dim_select( embed_adjacency_matrix(RDP.graph.2, 10)$D )
# Sample random vectors from hypersphere with radius 1.
lpvs.sph <- sample_sphere_surface(dim=10, n=20, radius=1)
RDP.graph.3 <- sample_dot_product(lpvs.sph)
dim_select( embed_adjacency_matrix(RDP.graph.3, 10)$D )