Sample finite-dimensional vectors to use as latent position vectors in random dot product graphs
Value
A dim
(length of the alpha
vector for
sample_dirichlet()
) times n
matrix, whose columns are the sample
vectors.
Details
sample_sphere_volume()
generates uniform samples from \(S^{dim-1}\)
(the (dim-1)
-sphere) i.e. the Euclidean norm of the samples is
smaller or equal to radius
.
See also
Other latent position vector samplers:
sample_dirichlet()
,
sample_sphere_surface()
Examples
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.7595066 0.8956383 0.4991772 0.9825116 0.8603311 0.9593032 0.8840607
#> [8] 0.8498412 0.5348308 0.9471041 0.5250083 0.8871807 0.9286141 0.9571271
#> [15] 0.8414267 0.8537723 0.9668634 0.7103317 0.7726310 0.9545622