EVOLUTION-MANAGER
Edit File: sample_correlated_gnp.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: Generate a new random graph from a given graph by randomly...</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_correlated_gnp {igraph}"><tr><td>sample_correlated_gnp {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Generate a new random graph from a given graph by randomly adding/removing edges</h2> <h3>Description</h3> <p>Sample a new graph by perturbing the adjacency matrix of a given graph and shuffling its vertices. </p> <h3>Usage</h3> <pre> sample_correlated_gnp( old.graph, corr, p = edge_density(old.graph), permutation = NULL ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>old.graph</code></td> <td> <p>The original graph.</p> </td></tr> <tr valign="top"><td><code>corr</code></td> <td> <p>A scalar in the unit interval, the target Pearson correlation between the adjacency matrices of the original and the generated graph (the adjacency matrix being used as a vector).</p> </td></tr> <tr valign="top"><td><code>p</code></td> <td> <p>A numeric scalar, the probability of an edge between two vertices, it must in the open (0,1) interval. The default is the empirical edge density of the graph. If you are resampling an Erdos-Renyi graph and you know the original edge probability of the Erdos-Renyi model, you should supply that explicitly.</p> </td></tr> <tr valign="top"><td><code>permutation</code></td> <td> <p>A numeric vector, a permutation vector that is applied on the vertices of the first graph, to get the second graph. If <code>NULL</code>, the vertices are not permuted.</p> </td></tr> </table> <h3>Details</h3> <p>Please see the reference given below. </p> <h3>Value</h3> <p>An unweighted graph of the same size as <code>old.graph</code> such that the correlation coefficient between the entries of the two adjacency matrices is <code>corr</code>. Note each pair of corresponding matrix entries is a pair of correlated Bernoulli random variables. </p> <h3>References</h3> <p>Lyzinski, V., Fishkind, D. E., Priebe, C. E. (2013). Seeded graph matching for correlated Erdos-Renyi graphs. <a href="https://arxiv.org/abs/1304.7844">https://arxiv.org/abs/1304.7844</a> </p> <h3>See Also</h3> <p><code><a href="sample_correlated_gnp_pair.html">sample_correlated_gnp_pair</a></code>, <code><a href="sample_gnp.html">sample_gnp</a></code> </p> <h3>Examples</h3> <pre> g <- sample_gnp(1000, .1) g2 <- sample_correlated_gnp(g, corr = 0.5) cor(as.vector(g[]), as.vector(g2[])) g g2 </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>