BlockModel.Gen | R Documentation |

Generates networks from degree corrected stochastic block model, with various options for node degree distribution

```
BlockModel.Gen(lambda, n, beta = 0, K = 3, w = rep(1, K),
Pi = rep(1, K)/K, rho = 0, simple = TRUE, power = TRUE,
alpha = 5, degree.seed = NULL)
```

`lambda` |
average node degree |

`n` |
size of network |

`beta` |
out-in ratio: the ratio of between-block edges over within-block edges |

`K` |
number of communities |

`w` |
not effective |

`Pi` |
a vector of community proportion |

`rho` |
proportion of small degrees within each community if the degrees are from two point mass disbribution. rho >0 gives degree corrected block model. If rho > 0 and simple=TRUE, then generate the degrees from two point mass distribution, with rho porition of 0.2 values and 1-rho proportion of 1 for degree parameters. If rho=0, generate from SBM. |

`simple` |
Indicator of wether two point mass degrees are used, if rho > 0. If rho=0, this is not effective |

`power` |
Whether or not use powerlaw distribution for degrees. If FALSE, generate from theta from U(0.2,1); if TRUE, generate theta from powerlaw. Only effective if rho >0, simple=FALSE. |

`alpha` |
Shape parameter for powerlaw distribution. |

`degree.seed` |
Can be a vector of a prespecified values for theta. Then the function will do sampling with replacement from the vector to generate theta. It can be used to control noise level between different configuration settings. |

A list of

`A` |
the generated network adjacency matrix |

`g ` |
community membership |

`P ` |
probability matrix of the network |

`theta ` |
node degree parameter |

Tianxi Li, Elizaveta Levina, Ji Zhu

Maintainer: Tianxi Li tianxili@virginia.edu

B. Karrer and M. E. Newman. Stochastic blockmodels and community structure in networks. Physical Review E, 83(1):016107, 2011.

A. A. Amini, A. Chen, P. J. Bickel, and E. Levina. Pseudo-likelihood methods for community detection in large sparse networks. The Annals of Statistics, 41(4):2097-2122, 2013.

T. Li, E. Levina, and J. Zhu. Network cross-validation by edge sampling. Biometrika, 107(2), pp.257-276, 2020.

```
dt <- BlockModel.Gen(30,300,K=3,beta=0.2,rho=0.9,simple=FALSE,power=TRUE)
```

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.