GrossSBM / missSBM

An R package for adjusting Stochastic Block Models from networks data sampled under various missing data conditions
http://grosssbm.github.io/missSBM
GNU General Public License v3.0
12 stars 2 forks source link

TASK: for testing network samplings, we need the theoretical expected sampling rate #4

Closed jchiquet closed 5 years ago

jchiquet commented 5 years ago

Consider the following piece of code for sampling in a 300-node SBM with various sampling schemes.

## SBM parameters
N <- 300
Q <- 3
alpha <- rep(1,Q)/Q                     # mixture parameter
pi <- diag(.45,Q) + .05                 # connectivity matrix
directed <- FALSE
# Draw a SBM model (Bernoulli, undirected)
mySBM <- simulateSBM(N, alpha, pi, directed)
A <- mySBM$adjacencyMatrix

## network samplings 
dyad  <- samplingSBM(A, "dyad", parameters =.1)
node  <- samplingSBM(A, "node", parameters =.1)
block <- samplingSBM(A, "block", parameters =c(.1, .2, .7), clusters = mySBM$memberships)
double_standard <- samplingSBM(A,"double_standard", parameters =c(0.1, 0.5))
degree <- samplingSBM(A,"degree", parameters =c(0.01,0.01))
snowball <- samplingSBM(A,"snowball", parameters =.3)

To test if each sampling given a network with a proportion of NA corresponding to what's expected, I need the theoretical sampling rate for each sampling design.

For instance, for the dyad samplign rate, it is simply the value of the parameters (0.1).

I need the theoretical expectation for the other ones as a function of the vector of parameters.

jchiquet commented 5 years ago

tim

jchiquet commented 5 years ago

Ok, now we need to complete the tests for block and degree sampling (done for node and dyad) in order to close this issue.

jchiquet commented 5 years ago

Thanks to Tim: tim