采样有限维向量以用作随机点积图中的潜在位置向量
值
一个 dim
(sample_dirichlet()
的 alpha
向量的长度)乘以 n
的矩阵,其列是样本向量。
参见
其他潜在位置向量采样器:sample_dirichlet()
, sample_sphere_surface()
示例
lpvs.sph.vol <- sample_sphere_volume(dim = 10, n = 20, radius = 1)
RDP.graph.4 <- sample_dot_product(lpvs.sph.vol)
vec.norm <- apply(lpvs.sph.vol, 2, function(x) {
sum(x^2)
})
vec.norm
#> [1] 0.9645606 0.9833405 0.8573243 0.8583842 0.8671172 0.7004469 0.8724793
#> [8] 0.8925446 0.9656338 0.9426489 0.9994651 0.4932614 0.9953153 0.8587619
#> [15] 0.9753917 0.8833000 0.7919691 0.9229842 0.9505931 0.9148534