EVOLUTION-MANAGER
Edit File: sample_sphere_surface.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Sample vectors uniformly from the surface of a sphere</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sample_sphere_surface {igraph}"><tr><td>sample_sphere_surface {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Sample vectors uniformly from the surface of a sphere</h2> <h3>Description</h3> <p>Sample finite-dimensional vectors to use as latent position vectors in random dot product graphs </p> <h3>Usage</h3> <pre> sample_sphere_surface(dim, n = 1, radius = 1, positive = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>dim</code></td> <td> <p>Integer scalar, the dimension of the random vectors.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Integer scalar, the sample size.</p> </td></tr> <tr valign="top"><td><code>radius</code></td> <td> <p>Numeric scalar, the radius of the sphere to sample.</p> </td></tr> <tr valign="top"><td><code>positive</code></td> <td> <p>Logical scalar, whether to sample from the positive orthant of the sphere.</p> </td></tr> </table> <h3>Details</h3> <p><code>sample_sphere_surface</code> generates uniform samples from <i>S^{dim-1}</i> (the <code>(dim-1)</code>-sphere) with radius <code>radius</code>, i.e. the Euclidean norm of the samples equal <code>radius</code>. </p> <h3>Value</h3> <p>A <code>dim</code> (length of the <code>alpha</code> vector for <code>sample_dirichlet</code>) times <code>n</code> matrix, whose columns are the sample vectors. </p> <h3>See Also</h3> <p>Other latent position vector samplers: <code><a href="sample_dirichlet.html">sample_dirichlet</a>()</code>, <code><a href="sample_sphere_volume.html">sample_sphere_volume</a>()</code> </p> <h3>Examples</h3> <pre> 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 </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>