R igraph 手册页

如果您从 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.

参见

embed_adjacency_matrix

示例


# 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 )


[包 igraph 版本 1.3.5 索引]