View source: R/incidence.from.distribution.R
incidence.from.distribution | R Documentation |
incidence.from.distribution
generates a random incidence matrix with row and column
sums that approximately follow beta distributions with given parameters.
incidence.from.distribution( R, C, P, rowdist = c(1, 1), coldist = c(1, 1), class = "matrix", narrative = TRUE )
R |
integer: number of rows |
C |
integer: number of columns |
P |
numeric: probability that a cell contains a 1 |
rowdist |
vector length 2: Row marginals will approximately follow a Beta(a,b) distribution |
coldist |
vector length 2: Column marginals will approximately follow a Beta(a,b) distribution |
class |
string: the class of the returned backbone graph, one of c("matrix", "Matrix", "igraph"). |
narrative |
boolean: TRUE if suggested text & citations should be displayed. |
An incidence matrix of class matrix
or Matrix
, or a bipartite graph of class igraph.
Neal, Z. P., Domagalski, R., and Sagan, B. 2021. Comparing alternatives to the fixed degree sequence model for extracting the backbone of bipartite projections. Scientific Reports, 11, 23929. doi: 10.1038/s41598-021-03238-3
Neal, Z. P. 2022. incidentally: An R package to generate incidence matrices and bipartite graphs. OSF Preprints doi: 10.31219/osf.io/ectms
I <- incidence.from.distribution(R = 100, C = 100, P = 0.1, rowdist = c(10000,10000), coldist = c(10000,10000)) #Constant I <- incidence.from.distribution(R = 100, C = 100, P = 0.1, rowdist = c(1,1), coldist = c(1,1)) #Uniform I <- incidence.from.distribution(R = 100, C = 100, P = 0.1, rowdist = c(1,10), coldist = c(1,10)) #Right-tailed I <- incidence.from.distribution(R = 100, C = 100, P = 0.1, rowdist = c(10,1), coldist = c(10,1)) #Left-tailed I <- incidence.from.distribution(R = 100, C = 100, P = 0.1, rowdist = c(10,10), coldist = c(10,10), narrative = TRUE) #Normal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.