generate_network: Generate graph structure

View source: R/network_gen.R

generate_networkR Documentation

Generate graph structure

Description

Generate graph structure.

Usage

generate_network(p, prob, NofHub = 3, type = c("scale-free", "hub", "random"))

Arguments

p

The number of nodes to generate graph structure.

prob

The probability that the edges of the random graph appear.

NofHub

The number of hub nodes in hub graph.

type

Types of graph structure. Either a character string representing one of the graph structures.

Value

A p x p adjacency matrix

References

Choi, H., J. Gim, S. Won, Y. J. Kim, S. Kwon, and C. Park, 2017: Network analysis for count data with excess zeros. BMC genetics, 18, no. 1, 1-10.
Park, B., H. Choi, C. Park, 2021: Negative binomial graphical model with excess zeros.

See Also

zilgm

Examples

require(ZILGM)
set.seed(1)
p = 30; prob = 2 / p;

# Random graph
random_graph = generate_network(p, prob, type = "random")

# Scale-free graph
scale_free_graph = generate_network(p, prob, type = "random")

# Hub graph
hub_graph = generate_network(p, prob, NofHub = 3, type = "hub")

bbeomjin/ZILGM documentation built on Aug. 5, 2023, 5:52 a.m.