Learn R Programming

complexNet (version 0.2.0)

avg_degree_bnr: Expected average degree of BNR networks

Description

Calculates the expected average degree of a BNR network (single parent only) based on the approximation by Ilany and Akcay, 2016 (see details).

Usage

avg_degree_bnr(n, pb, pn, pr)

# S4 method for numeric,numeric,numeric,numeric avg_degree_bnr(n, pb, pn, pr)

Value

Returns the expected average degree of a BNR network as a numeric value. This value is an analytic result and not a numeric approximation (compare examples below).

Arguments

n

Number of nodes in the network

pb

Probability to connect to parent (default is 1)

pn

Probability to connect to neighbour of parent(s)

pr

Probability to connect to individuals that are not connected to

Details

The expected average degree \(\bar{d}\) is calculated as $$ \bar{d} = \frac{(N-1)(p_b + (N-2)p_r)}{N-1-(N-2)(p_n - p_r)} $$

References

Ilany, A., and Akçay, E. (2016). Personality and Social Networks: A Generative Model Approach. Integrative and Comparative Biology, 56(6), 1197–1205. tools:::Rd_expr_doi("10.1093/icb/icw068")

Examples

Run this code
# Expected degree
avg_degree_bnr(n = 100, pb = 1, pn = .2, pr = .02)
# Compare to simulated network with identical parameters
adjm <- make_bnr(n = 100, np = c(0,0), pb = 1, pn = .2, pr = .02)
mean(adjm) * 100

Run the code above in your browser using DataLab