generate_graph.sbm_4group: draw a random graph from a stochastic blockmodel with four...

View source: R/stochastic_block_model.R

generate_graph.sbm_4groupR Documentation

draw a random graph from a stochastic blockmodel with four blocks

Description

Draw a random graph from a stochastic blockmodel where the groups are determined by membership in the frame population (F) and membership in the hidden population (H). Membership in F is assumed to be independent of membership in H, and vice-versa.

Usage

## S3 method for class 'sbm_4group'
generate_graph(params)

Arguments

sim.settings

a list whose entries contain the parameter values which govern this random graph draw (see details)

type

either 'simple' or 'nested', depending on the type of inhomogenous mixing; see pref.matrix.4group.1param

Details

The four groups, as determined by membership in F and H, are FH, FnotH, notF,notH, notFH.

The sim.settings list should have entries

  • N the size of the entire population

  • p.F the prevalence of the frame population (N.F/N)

  • p.H the prevalence of the hidden population (N.H/N)

  • p.F.given.H the probability of being in F, given that a node is in H; if not specified, assume the probabilities are independent, so that p.F.given.H = p.F

  • zeta the probability of forming a tie for a pair of nodes in the same group

  • rho the relative probability of edge between two nodes that are not in the same group (for example, between a node in FnotH and FH). if rho is 0.8, then edges between FnotH and FH are 80 FnotH and FnotH (or FH and FH)

  • tau the true positive rate

The overall level of connectivity in the graph can be controlled by varying zeta. The extent to which members of the group are homogenously mixed can be controlled by varying rho. For example, when rho is 1, then all four groups are perfectly mixed with the entire population. When rho is less than 1, members of the same group tend to form ties with one another more than with others. And when rho is greater than 1, members of the same group tend to form ties with others more than with one another.

Value

an igraph graph, drawn according to the settings passed in


dfeehan/nrsimulatr documentation built on Feb. 27, 2024, 3:18 a.m.