Learn R Programming

EpiModel (version 1.8.0)

check_bip_degdist: Check Degree Distribution for Bipartite Target Statistics

Description

Checks for consistency in the implied network statistics of a bipartite network in which the mode size and mode-specific degree distributions are specified.

Usage

check_bip_degdist(num.m1, num.m2, deg.dist.m1, deg.dist.m2)

Arguments

num.m1

Number of nodes in mode 1.

num.m2

Number of nodes in mode 2.

deg.dist.m1

Vector with fractional degree distribution for mode 1.

deg.dist.m2

Vector with fractional degree distribution for mode 2.

Details

This function outputs the number of nodes of degree 0 to m, where m is the length of a fractional degree distribution vector, given that vector and the size of the mode. This utility is used to check for balance in implied degree given that fractional distribution within bipartite network simulations, in which the degree-constrained counts must be equal across modes.

See Also

For a detailed explanation of this function, see the tutorial: EpiModel Network Utility Functions.

Examples

Run this code
# NOT RUN {
# An imbalanced distribution
check_bip_degdist(num.m1 = 500, num.m2 = 500,
                  deg.dist.m2 = c(0.40, 0.55, 0.03, 0.02),
                  deg.dist.m1 = c(0.48, 0.41, 0.08, 0.03))

# A balanced distribution
check_bip_degdist(num.m1 = 500, num.m2 = 500,
                  deg.dist.m1 = c(0.40, 0.55, 0.04, 0.01),
                  deg.dist.m2 = c(0.48, 0.41, 0.08, 0.03))

# }

Run the code above in your browser using DataLab