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.9695363 0.8956247 0.7890727 0.9099193 0.8082466 0.6814650 0.8015615
#> [8] 0.6854446 0.9366488 0.9621427 0.8611745 0.9026940 0.9672089 0.7383768
#> [15] 0.8888156 0.8672372 0.8467979 0.9401608 0.9422975 0.7542589
