R igraph 手册页

如果您从 R 中使用 igraph,请使用此选项

sample_sphere_surface {igraph}R 文档

从球体表面均匀采样向量

描述

采样有限维向量,用作随机点积图中的潜在位置向量

用法

sample_sphere_surface(dim, n = 1, radius = 1, positive = TRUE)

参数

dim

整数标量,随机向量的维度。

n

整数标量,样本大小。

半径

数值标量,球体的采样半径。

正数

逻辑标量,是否从球体的正象限采样。

详细信息

sample_sphere_surface 从半径为 radiusS^{dim-1}(dim-1) 维球体)生成均匀样本,即样本的欧几里得范数等于 radius

一个 dim (sample_dirichletalpha 向量的长度) 乘以 n 的矩阵,其列是样本向量。

参见

其他潜在位置向量采样器:sample_dirichlet(), sample_sphere_volume()

示例

lpvs.sph    <- sample_sphere_surface(dim=10, n=20, radius=1)
RDP.graph.3 <- sample_dot_product(lpvs.sph)
vec.norm    <- apply(lpvs.sph, 2, function(x) { sum(x^2) })
vec.norm

[包 igraph 版本 1.3.5 索引]