EVOLUTION-MANAGER
Edit File: sample_sbm.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 stochastic block model</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_sbm {igraph}"><tr><td>sample_sbm {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Sample stochastic block model</h2> <h3>Description</h3> <p>Sampling from the stochastic block model of networks </p> <h3>Usage</h3> <pre> sample_sbm(n, pref.matrix, block.sizes, directed = FALSE, loops = FALSE) sbm(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>n</code></td> <td> <p>Number of vertices in the graph.</p> </td></tr> <tr valign="top"><td><code>pref.matrix</code></td> <td> <p>The matrix giving the Bernoulli rates. This is a <i>KxK</i> matrix, where <i>K</i> is the number of groups. The probability of creating an edge between vertices from groups <i>i</i> and <i>j</i> is given by element <i>(i,j)</i>. For undirected graphs, this matrix must be symmetric.</p> </td></tr> <tr valign="top"><td><code>block.sizes</code></td> <td> <p>Numeric vector giving the number of vertices in each group. The sum of the vector must match the number of vertices.</p> </td></tr> <tr valign="top"><td><code>directed</code></td> <td> <p>Logical scalar, whether to generate a directed graph.</p> </td></tr> <tr valign="top"><td><code>loops</code></td> <td> <p>Logical scalar, whether self-loops are allowed in the graph.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Passed to <code>sample_sbm</code>.</p> </td></tr> </table> <h3>Details</h3> <p>This function samples graphs from a stochastic block model by (doing the equivalent of) Bernoulli trials for each potential edge with the probabilities given by the Bernoulli rate matrix, <code>pref.matrix</code>. The order of the vertices in the generated graph corresponds to the <code>block.sizes</code> argument. </p> <h3>Value</h3> <p>An igraph graph. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>References</h3> <p>Faust, K., & Wasserman, S. (1992a). Blockmodels: Interpretation and evaluation. <em>Social Networks</em>, 14, 5–61. </p> <h3>See Also</h3> <p><code><a href="sample_gnp.html">sample_gnp</a></code>, <code><a href="sample_gnm.html">sample_gnm</a></code> </p> <h3>Examples</h3> <pre> ## Two groups with not only few connection between groups pm <- cbind( c(.1, .001), c(.001, .05) ) g <- sample_sbm(1000, pref.matrix=pm, block.sizes=c(300,700)) g </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>