gen_adj_mat: Generate a true adjacency matrix

Description Usage Arguments Details Value

View source: R/gen_adj_mat.R

Description

Generate a desired graph (with igraph format) with corresponding adjacency matrix as an binary matrix. If (i,j) is one, it implies there exists an edge i -> j.

Usage

1
2
3
4
5
gen_adj_mat(
  n_nodes,
  graph_type = c("bi", "rand", "sf", "sw", "tree"),
  seed = NA
)

Arguments

n_nodes

positive integer scalar (larger than 1), the number of nodes of the desired graph. For the Bipartite graph, it should be even.

graph_type

character scalar, one of types of graphs in the simulation studies. See details below for more information.

seed

integer scalar, in order to reproduce the same graph.

Details

There are seven graph types in the simulation studies: "bi" for Bipartite graph, "sf" for Scale-Free graph, "sw" for Small-World, "tree" for the tree with two children, "rand" for random DAG, and "chain" for a Chain graph. Except "rand", all the other graphs generated based on R package igraph. The Random DAG is generated based on R package pcalg.

Value

A_true

an adjacency matrix of the graph_true


yongsu-lee/NOTEARGIS documentation built on Dec. 27, 2020, 6:58 p.m.