R igraph manual pages

Use this if you are using igraph from R

 sample_sphere_surface {igraph} R Documentation

Sample vectors uniformly from the surface of a sphere

Description

Sample finite-dimensional vectors to use as latent position vectors in random dot product graphs

Usage

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


Arguments

 dim Integer scalar, the dimension of the random vectors. n Integer scalar, the sample size. radius Numeric scalar, the radius of the sphere to sample. positive Logical scalar, whether to sample from the positive orthant of the sphere.

Details

sample_sphere_surface generates uniform samples from S^{dim-1} (the (dim-1)-sphere) with radius radius, i.e. the Euclidean norm of the samples equal radius.

Value

A dim (length of the alpha vector for sample_dirichlet) times n matrix, whose columns are the sample vectors.

Other latent position vector samplers: sample_dirichlet(), sample_sphere_volume()
lpvs.sph    <- sample_sphere_surface(dim=10, n=20, radius=1)