Description Usage Arguments Details Value See Also Examples

View source: R/embedding.R View source: R/auto.R

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

1 | ```
sample_sphere_volume(dim, n = 1, radius = 1, positive = TRUE)
``` |

`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. |

`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`

.

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_surface`

1 2 3 4 | ```
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
``` |

igraph documentation built on July 21, 2017, 7:18 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.