Learn R Programming

fake (version 1.4.0)

MinWithinProba: Within-group probabilities for communities

Description

Computes the smallest within-group probabilities that can be used to simulate a graph where communities can be expected for given probabilities of between-group probabilities and group sizes.

Usage

MinWithinProba(pk, nu_between = 0, nu_mat = NULL)

Value

A vector of within-group probabilities.

Arguments

pk

vector of the number of variables per group in the simulated dataset. The number of nodes in the simulated graph is sum(pk). With multiple groups, the simulated (partial) correlation matrix has a block structure, where blocks arise from the integration of the length(pk) groups. This argument is only used if theta is not provided.

nu_between

probability of having an edge between two nodes belonging to different groups, as defined in pk. By default, the same density is used for within and between blocks (nu_within=nu_between). Only used if length(pk)>1. Only used if nu_mat is not provided.

nu_mat

matrix of probabilities of having an edge between nodes belonging to a given pair of node groups defined in pk. Only off-diagonal entries are used.

Details

The vector of within-group probabilities is the smallest one that can be used to generate an expected total within degree \(D^w_k\) strictly higher than the expected total between degree \(D^b_k\) for all communities \(k\) (see ExpectedCommunities). Namely, using the suggested within-group probabilities would give expected \(D^w_k = D^b_k + 1\).

See Also

ExpectedCommunities, SimulateAdjacency, SimulateGraphical

Examples

Run this code
# Simulation parameters
pk <- rep(20, 4)
nu_between <- 0.1

# Estimating smallest nu_within
nu_within <- MinWithinProba(pk = pk, nu_between = nu_between)

# Expected metrics
ExpectedCommunities(
  pk = pk,
  nu_within = max(nu_within),
  nu_between = nu_between
)

Run the code above in your browser using DataLab