random.dag: Generate random DAGs

Description Usage Arguments Details Value

View source: R/sparsebnUtils-generate.R

Description

Generate a random DAG with fixed number of edges.

Usage

1
random.dag(nnode, nedge, FUN = NULL, permute = TRUE)

Arguments

nnode

Number of nodes in the DAG.

nedge

Number of edges in the DAG.

FUN

Optional function to be used as a random number generator.

permute

If TRUE, order of nodes will be randomly permuted. If FALSE, output will be ordered according to its topological sort, i.e. with a lower-triangular adjacency matrix.

Details

FUN can be any function whose first argument is called n. This allows for both random and deterministic outputs.

Value

An (weighted) adjacency matrix.


sparsebnUtils documentation built on Jan. 27, 2021, 9:05 a.m.